From 70bb14de54703459d1e5bd7aff6d85a10aa932b7 Mon Sep 17 00:00:00 2001 From: Viktor Kuzmin Date: Mon, 7 Aug 2023 11:28:48 +0300 Subject: Controller should be run as deployment - it doesn't have any statefull data --- .../seaweedfs-csi-driver/templates/deployment.yaml | 119 ++++++++++++++++++++ .../templates/statefulset.yaml | 120 --------------------- 2 files changed, 119 insertions(+), 120 deletions(-) create mode 100644 deploy/helm/seaweedfs-csi-driver/templates/deployment.yaml delete mode 100644 deploy/helm/seaweedfs-csi-driver/templates/statefulset.yaml (limited to 'deploy') diff --git a/deploy/helm/seaweedfs-csi-driver/templates/deployment.yaml b/deploy/helm/seaweedfs-csi-driver/templates/deployment.yaml new file mode 100644 index 0000000..7d305ed --- /dev/null +++ b/deploy/helm/seaweedfs-csi-driver/templates/deployment.yaml @@ -0,0 +1,119 @@ +--- +kind: Deployment +apiVersion: apps/v1 +metadata: + name: {{ template "seaweedfs-csi-driver.name" . }}-controller +spec: + selector: + matchLabels: + app: {{ template "seaweedfs-csi-driver.name" . }}-controller + replicas: 1 + template: + metadata: + labels: + app: {{ template "seaweedfs-csi-driver.name" . }}-controller + spec: + priorityClassName: system-cluster-critical + serviceAccountName: {{ template "seaweedfs-csi-driver.name" . }}-controller-sa + {{- with .Values.controller.affinity }} + affinity: {{ toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.controller.tolerations }} + tolerations: {{ toYaml . | nindent 8 }} + {{- end }} + containers: + # provisioner + - name: csi-provisioner + image: {{ .Values.csiProvisioner.image }} + args: + - "--csi-address=$(ADDRESS)" + - -v + - "9" + env: + - name: ADDRESS + value: /var/lib/csi/sockets/pluginproxy/csi.sock + imagePullPolicy: {{ .Values.imagePullPolicy }} + volumeMounts: + - name: socket-dir + mountPath: /var/lib/csi/sockets/pluginproxy/ + resources: + {{ toYaml .Values.csiProvisioner.resources | nindent 12 }} + # attacher + - name: csi-attacher + image: {{ .Values.csiAttacher.image }} + args: + - "--v=5" + - "--csi-address=$(ADDRESS)" + - "--timeout=120s" + env: + - name: ADDRESS + value: /var/lib/csi/sockets/pluginproxy/csi.sock + imagePullPolicy: {{ .Values.imagePullPolicy }} + resources: + {{ toYaml .Values.csiAttacher.resources | nindent 12 }} + volumeMounts: + - name: socket-dir + mountPath: /var/lib/csi/sockets/pluginproxy/ + # resizer + - name: csi-resizer + image: {{ .Values.csiResizer.image }} + args: + - "--v=5" + - "--csi-address=$(ADDRESS)" + - "--leader-election=false" + env: + - name: ADDRESS + value: /var/lib/csi/sockets/pluginproxy/csi.sock + imagePullPolicy: {{ .Values.imagePullPolicy }} + resources: + {{ toYaml .Values.csiAttacher.resources | nindent 12 }} + volumeMounts: + - name: socket-dir + mountPath: /var/lib/csi/sockets/pluginproxy/ + # SeaweedFs Plugin + - name: seaweedfs-csi-plugin + image: {{.Values.seaweedfsCsiPlugin.image}} + imagePullPolicy: {{ .Values.imagePullPolicy }} + args : + - "--endpoint=$(CSI_ENDPOINT)" + - "--filer=$(SEAWEEDFS_FILER)" + - "--nodeid=$(NODE_ID)" + - "--node" + - "--controller" + - "--attacher" + env: + - name: CSI_ENDPOINT + value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock + - name: SEAWEEDFS_FILER + value: {{ .Values.seaweedfsFiler | quote }} + - name: NODE_ID + valueFrom: + fieldRef: + fieldPath: spec.nodeName + {{- if .Values.tlsSecret }} + - name: WEED_GRPC_CLIENT_KEY + value: /var/run/secrets/app/tls/tls.key + - name: WEED_GRPC_CLIENT_CERT + value: /var/run/secrets/app/tls/tls.crt + - name: WEED_GRPC_CA + value: /var/run/secrets/app/tls/ca.crt + {{- end }} + {{- if .Values.logVerbosity }} + - name: WEED_V + value: {{ .Values.logVerbosity | quote }} + {{- end }} + volumeMounts: + - name: socket-dir + mountPath: /var/lib/csi/sockets/pluginproxy/ + {{- if .Values.tlsSecret }} + - name: tls + mountPath: /var/run/secrets/app/tls + {{- end }} + volumes: + - name: socket-dir + emptyDir: {} + {{- if .Values.tlsSecret }} + - name: tls + secret: + secretName: {{ .Values.tlsSecret }} + {{- end }} diff --git a/deploy/helm/seaweedfs-csi-driver/templates/statefulset.yaml b/deploy/helm/seaweedfs-csi-driver/templates/statefulset.yaml deleted file mode 100644 index 6d5c16b..0000000 --- a/deploy/helm/seaweedfs-csi-driver/templates/statefulset.yaml +++ /dev/null @@ -1,120 +0,0 @@ ---- -kind: StatefulSet -apiVersion: apps/v1 -metadata: - name: {{ template "seaweedfs-csi-driver.name" . }}-controller -spec: - selector: - matchLabels: - app: {{ template "seaweedfs-csi-driver.name" . }}-controller - serviceName: "csi-seaweedfs" - replicas: 1 - template: - metadata: - labels: - app: {{ template "seaweedfs-csi-driver.name" . }}-controller - spec: - priorityClassName: system-cluster-critical - serviceAccountName: {{ template "seaweedfs-csi-driver.name" . }}-controller-sa - {{- with .Values.controller.affinity }} - affinity: {{ toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.controller.tolerations }} - tolerations: {{ toYaml . | nindent 8 }} - {{- end }} - containers: - # provisioner - - name: csi-provisioner - image: {{ .Values.csiProvisioner.image }} - args: - - "--csi-address=$(ADDRESS)" - - -v - - "9" - env: - - name: ADDRESS - value: /var/lib/csi/sockets/pluginproxy/csi.sock - imagePullPolicy: {{ .Values.imagePullPolicy }} - volumeMounts: - - name: socket-dir - mountPath: /var/lib/csi/sockets/pluginproxy/ - resources: - {{ toYaml .Values.csiProvisioner.resources | nindent 12 }} - # attacher - - name: csi-attacher - image: {{ .Values.csiAttacher.image }} - args: - - "--v=5" - - "--csi-address=$(ADDRESS)" - - "--timeout=120s" - env: - - name: ADDRESS - value: /var/lib/csi/sockets/pluginproxy/csi.sock - imagePullPolicy: {{ .Values.imagePullPolicy }} - resources: - {{ toYaml .Values.csiAttacher.resources | nindent 12 }} - volumeMounts: - - name: socket-dir - mountPath: /var/lib/csi/sockets/pluginproxy/ - # resizer - - name: csi-resizer - image: {{ .Values.csiResizer.image }} - args: - - "--v=5" - - "--csi-address=$(ADDRESS)" - - "--leader-election=false" - env: - - name: ADDRESS - value: /var/lib/csi/sockets/pluginproxy/csi.sock - imagePullPolicy: {{ .Values.imagePullPolicy }} - resources: - {{ toYaml .Values.csiAttacher.resources | nindent 12 }} - volumeMounts: - - name: socket-dir - mountPath: /var/lib/csi/sockets/pluginproxy/ - # SeaweedFs Plugin - - name: seaweedfs-csi-plugin - image: {{.Values.seaweedfsCsiPlugin.image}} - imagePullPolicy: {{ .Values.imagePullPolicy }} - args : - - "--endpoint=$(CSI_ENDPOINT)" - - "--filer=$(SEAWEEDFS_FILER)" - - "--nodeid=$(NODE_ID)" - - "--node" - - "--controller" - - "--attacher" - env: - - name: CSI_ENDPOINT - value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock - - name: SEAWEEDFS_FILER - value: {{ .Values.seaweedfsFiler | quote }} - - name: NODE_ID - valueFrom: - fieldRef: - fieldPath: spec.nodeName - {{- if .Values.tlsSecret }} - - name: WEED_GRPC_CLIENT_KEY - value: /var/run/secrets/app/tls/tls.key - - name: WEED_GRPC_CLIENT_CERT - value: /var/run/secrets/app/tls/tls.crt - - name: WEED_GRPC_CA - value: /var/run/secrets/app/tls/ca.crt - {{- end }} - {{- if .Values.logVerbosity }} - - name: WEED_V - value: {{ .Values.logVerbosity | quote }} - {{- end }} - volumeMounts: - - name: socket-dir - mountPath: /var/lib/csi/sockets/pluginproxy/ - {{- if .Values.tlsSecret }} - - name: tls - mountPath: /var/run/secrets/app/tls - {{- end }} - volumes: - - name: socket-dir - emptyDir: {} - {{- if .Values.tlsSecret }} - - name: tls - secret: - secretName: {{ .Values.tlsSecret }} - {{- end }} -- cgit v1.2.3