diff --git a/changelogs/unreleased/999-evgkrsk b/changelogs/unreleased/999-evgkrsk new file mode 100644 index 00000000..a7092cdc --- /dev/null +++ b/changelogs/unreleased/999-evgkrsk @@ -0,0 +1 @@ +Change lvm-controller's Kind from StatefulSet to Deployment (#196) \ No newline at end of file diff --git a/deploy/helm/charts/README.md b/deploy/helm/charts/README.md index 239c8c3d..334c4a2c 100644 --- a/deploy/helm/charts/README.md +++ b/deploy/helm/charts/README.md @@ -47,10 +47,10 @@ $ helm install [RELEASE_NAME] openebs-lvmlocalpv/lvm-localpv --namespace [NAMESP **Note:** If moving from the operator to helm -- Make sure the namespace provided in the helm install command is same as `LVM_NAMESPACE` (by default it is `openebs`) env in the controller statefulset. -- Before installing, clean up the stale statefulset and daemonset from `kube-system` namespace using the below commands +- Make sure the namespace provided in the helm install command is same as `LVM_NAMESPACE` (by default it is `openebs`) env in the controller deployment. +- Before installing, clean up the stale deployment and daemonset from `kube-system` namespace using the below commands ```sh -kubectl delete sts openebs-lvm-controller -n kube-system +kubectl delete deployment openebs-lvm-controller -n kube-system kubectl delete ds openebs-lvm-node -n kube-system ``` @@ -133,15 +133,16 @@ helm install openebs-lvmlocalpv openebs-lvmlocalpv/lvm-localpv --namespace opene | `lvmController.provisioner.image.repository` | Image repository for csi-provisioner | `sig-storage/csi-provisioner` | | `lvmController.provisioner.image.pullPolicy` | Image pull policy for csi-provisioner | `IfNotPresent` | | `lvmController.provisioner.image.tag` | Image tag for csi-provisioner | `v3.5.0` | -| `lvmController.updateStrategy.type` | Update strategy for lvm localpv controller statefulset | `RollingUpdate` | -| `lvmController.annotations` | Annotations for lvm localpv controller statefulset metadata | `""` | -| `lvmController.podAnnotations` | Annotations for lvm localpv controller statefulset's pods metadata | `""` | -| `lvmController.resources` | Resource and request and limit for lvm localpv controller statefulset containers | `""` | -| `lvmController.labels` | Labels for lvm localpv controller statefulset metadata | `""` | -| `lvmController.podLabels` | Appends labels to the lvm localpv controller statefulset pods | `""` | -| `lvmController.nodeSelector` | Nodeselector for lvm localpv controller statefulset pods | `""` | -| `lvmController.tolerations` | lvm localpv controller statefulset's pod toleration values | `""` | -| `lvmController.securityContext` | Seurity context for lvm localpv controller statefulset container | `""` | +| `lvmController.updateStrategy.type` | Update strategy for lvm localpv controller deployment | `RollingUpdate` | +| `lvmController.annotations` | Annotations for lvm localpv controller deployment metadata | `""` | +| `lvmController.podAnnotations` | Annotations for lvm localpv controller deployment's pods metadata | `""` | +| `lvmController.resources` | Resource and request and limit for lvm localpv controller deployment containers | `""` | +| `lvmController.labels` | Labels for lvm localpv controller deployment metadata | `""` | +| `lvmController.podLabels` | Appends labels to the lvm localpv controller deployment pods | `""` | +| `lvmController.nodeSelector` | Nodeselector for lvm localpv controller deployment pods | `""` | +| `lvmController.tolerations` | lvm localpv controller deployment's pod toleration values | `""` | +| `lvmController.topologySpreadConstraints` | lvm localpv controller deployment's pod topologySpreadConstraints values | `""` | +| `lvmController.securityContext` | Security context for lvm localpv controller deployment container | `""` | | `rbac.pspEnabled` | Enable PodSecurityPolicy | `false` | | `serviceAccount.lvmNode.create` | Create a service account for lvmnode or not | `true` | | `serviceAccount.lvmNode.name` | Name for the lvmnode service account | `openebs-lvm-node-sa` | diff --git a/deploy/helm/charts/templates/lvm-controller.yaml b/deploy/helm/charts/templates/lvm-controller.yaml index b5029971..e566119a 100644 --- a/deploy/helm/charts/templates/lvm-controller.yaml +++ b/deploy/helm/charts/templates/lvm-controller.yaml @@ -1,5 +1,5 @@ apiVersion: apps/v1 -kind: StatefulSet +kind: Deployment metadata: name: {{ template "lvmlocalpv.fullname" . }}-controller {{- with .Values.lvmController.annotations }} @@ -11,7 +11,6 @@ spec: selector: matchLabels: {{- include "lvmlocalpv.lvmController.matchLabels" . | nindent 6 }} - serviceName: "{{ .Values.lvmController.serviceName }}" replicas: {{ .Values.lvmController.replicas }} template: metadata: @@ -157,3 +156,7 @@ spec: tolerations: {{ toYaml .Values.lvmController.tolerations | indent 8 }} {{- end }} +{{- if .Values.lvmController.topologySpreadConstraints }} + topologySpreadConstraints: +{{ toYaml .Values.lvmController.topologySpreadConstraints | indent 8 }} +{{- end }} diff --git a/deploy/helm/charts/values.yaml b/deploy/helm/charts/values.yaml index f6c4da6b..0aab6bb5 100644 --- a/deploy/helm/charts/values.yaml +++ b/deploy/helm/charts/values.yaml @@ -64,11 +64,10 @@ lvmNode: # lvmController contains the configurables for -# the lvm controller statefulset +# the lvm controller deployment lvmController: componentName: openebs-lvm-controller replicas: 1 - serviceName: openebs-lvm logLevel: 5 resizer: name: "csi-resizer" @@ -126,6 +125,7 @@ lvmController: name: openebs-lvm-controller nodeSelector: {} tolerations: [] + topologySpreadConstraints: [] securityContext: {} priorityClass: create: true @@ -139,7 +139,7 @@ lvmController: burst: 0 # lvmPlugin is the common csi container used by the -# controller statefulset and node daemonset +# controller deployment and node daemonset lvmPlugin: name: "openebs-lvm-plugin" image: