kind: Deployment apiVersion: apps/v1 metadata: name: csi-cephfsplugin-provisioner namespace: {{ .Namespace }} spec: replicas: {{ .ProvisionerReplicas }} selector: matchLabels: app: csi-cephfsplugin-provisioner template: metadata: labels: app: csi-cephfsplugin-provisioner contains: csi-cephfsplugin-metrics {{ range $key, $value := .CSICephFSPodLabels }} {{ $key }}: "{{ $value }}" {{ end }} spec: serviceAccountName: rook-csi-cephfs-provisioner-sa {{ if .ProvisionerPriorityClassName }} priorityClassName: {{ .ProvisionerPriorityClassName }} {{ end }} containers: {{ if .CephFSAttachRequired }} - name: csi-attacher image: {{ .AttacherImage }} args: - "--v={{ .SidecarLogLevel }}" - "--csi-address=$(ADDRESS)" - "--leader-election=true" - "--timeout={{ .GRPCTimeout }}" - "--leader-election-namespace={{ .Namespace }}" - "--leader-election-lease-duration={{ .LeaderElectionLeaseDuration }}" - "--leader-election-renew-deadline={{ .LeaderElectionRenewDeadline }}" - "--leader-election-retry-period={{ .LeaderElectionRetryPeriod }}" env: - name: ADDRESS value: /csi/csi-provisioner.sock imagePullPolicy: {{ .ImagePullPolicy }} volumeMounts: - name: socket-dir mountPath: /csi {{ end }} {{ if .EnableCephFSSnapshotter }} - name: csi-snapshotter image: {{ .SnapshotterImage }} args: - "--csi-address=$(ADDRESS)" - "--v={{ .SidecarLogLevel }}" - "--timeout={{ .GRPCTimeout }}" - "--leader-election=true" - "--leader-election-namespace={{ .Namespace }}" - "--leader-election-lease-duration={{ .LeaderElectionLeaseDuration }}" - "--leader-election-renew-deadline={{ .LeaderElectionRenewDeadline }}" - "--leader-election-retry-period={{ .LeaderElectionRetryPeriod }}" - "--extra-create-metadata=true" {{ if .VolumeGroupSnapshotSupported }} - "--enable-volume-group-snapshots={{ .EnableVolumeGroupSnapshot }}" {{ end }} env: - name: ADDRESS value: unix:///csi/csi-provisioner.sock imagePullPolicy: {{ .ImagePullPolicy }} volumeMounts: - name: socket-dir mountPath: /csi {{ end }} - name: csi-resizer image: {{ .ResizerImage }} args: - "--csi-address=$(ADDRESS)" - "--v={{ .SidecarLogLevel }}" - "--timeout={{ .GRPCTimeout }}" - "--leader-election=true" - "--leader-election-namespace={{ .Namespace }}" - "--leader-election-lease-duration={{ .LeaderElectionLeaseDuration }}" - "--leader-election-renew-deadline={{ .LeaderElectionRenewDeadline }}" - "--leader-election-retry-period={{ .LeaderElectionRetryPeriod }}" - "--handle-volume-inuse-error=false" - "--feature-gates=RecoverVolumeExpansionFailure=true" env: - name: ADDRESS value: unix:///csi/csi-provisioner.sock imagePullPolicy: {{ .ImagePullPolicy }} volumeMounts: - name: socket-dir mountPath: /csi - name: csi-provisioner image: {{ .ProvisionerImage }} args: - "--csi-address=$(ADDRESS)" - "--v={{ .SidecarLogLevel }}" - "--timeout={{ .GRPCTimeout }}" - "--retry-interval-start=500ms" - "--leader-election=true" - "--leader-election-namespace={{ .Namespace }}" - "--feature-gates=HonorPVReclaimPolicy=true" - "--prevent-volume-mode-conversion=true" - "--leader-election-lease-duration={{ .LeaderElectionLeaseDuration }}" - "--leader-election-renew-deadline={{ .LeaderElectionRenewDeadline }}" - "--leader-election-retry-period={{ .LeaderElectionRetryPeriod }}" - "--extra-create-metadata=true" env: - name: ADDRESS value: unix:///csi/csi-provisioner.sock imagePullPolicy: {{ .ImagePullPolicy }} volumeMounts: - name: socket-dir mountPath: /csi - name: csi-cephfsplugin image: {{ .CSIPluginImage }} args: - "--nodeid=$(NODE_ID)" - "--type=cephfs" - "--endpoint=$(CSI_ENDPOINT)" - "--v={{ .LogLevel }}" - "--controllerserver=true" - "--drivername={{ .DriverNamePrefix }}cephfs.csi.ceph.com" - "--pidlimit=-1" - "--forcecephkernelclient={{ .ForceCephFSKernelClient }}" {{ if .CSIEnableMetadata }} - "--setmetadata={{ .CSIEnableMetadata }}" {{ end }} {{ if .CSIClusterName }} - "--clustername={{ .CSIClusterName }}" {{ end }} {{ if .EnableCSIAddonsSideCar }} - "--csi-addons-endpoint=$(CSIADDONS_ENDPOINT)" {{ end }} env: - name: POD_IP valueFrom: fieldRef: fieldPath: status.podIP - name: NODE_ID valueFrom: fieldRef: fieldPath: spec.nodeName - name: POD_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace - name: CSI_ENDPOINT value: unix:///csi/csi-provisioner.sock {{ if .EnableCSIAddonsSideCar }} - name: CSIADDONS_ENDPOINT value: unix:///csi/csi-addons.sock {{ end }} imagePullPolicy: {{ .ImagePullPolicy }} volumeMounts: - name: socket-dir mountPath: /csi - name: host-sys mountPath: /sys - name: lib-modules mountPath: /lib/modules readOnly: true - name: host-dev mountPath: /dev - name: ceph-csi-config mountPath: /etc/ceph-csi-config/ - name: keys-tmp-dir mountPath: /tmp/csi/keys {{ if .MountCustomCephConf }} - name: ceph-config mountPath: /etc/ceph/ceph.conf subPath: ceph.conf {{ end }} {{ if .EnableCSIAddonsSideCar }} - name: csi-addons image: {{ .CSIAddonsImage }} args : - "--node-id=$(NODE_ID)" - "--v={{ .LogLevel }}" - "--csi-addons-address=$(CSIADDONS_ENDPOINT)" - "--controller-port={{ .CSIAddonsPort }}" - "--pod=$(POD_NAME)" - "--namespace=$(POD_NAMESPACE)" - "--pod-uid=$(POD_UID)" - "--stagingpath={{ .KubeletDirPath }}/plugins/kubernetes.io/csi/" - "--leader-election-namespace={{ .Namespace }}" - "--leader-election-lease-duration={{ .LeaderElectionLeaseDuration }}" - "--leader-election-renew-deadline={{ .LeaderElectionRenewDeadline }}" - "--leader-election-retry-period={{ .LeaderElectionRetryPeriod }}" ports: - containerPort: {{ .CSIAddonsPort }} env: - name: NODE_ID valueFrom: fieldRef: fieldPath: spec.nodeName - name: POD_UID valueFrom: fieldRef: fieldPath: metadata.uid - name: POD_NAME valueFrom: fieldRef: fieldPath: metadata.name - name: POD_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace - name: CSIADDONS_ENDPOINT value: unix:///csi/csi-addons.sock imagePullPolicy: {{ .ImagePullPolicy }} volumeMounts: - name: socket-dir mountPath: /csi {{ end }} {{ if .EnableLiveness }} - name: liveness-prometheus image: {{ .CSIPluginImage }} args: - "--type=liveness" - "--endpoint=$(CSI_ENDPOINT)" - "--metricsport={{ .CephFSLivenessMetricsPort }}" - "--metricspath=/metrics" - "--polltime=60s" - "--timeout=3s" env: - name: CSI_ENDPOINT value: unix:///csi/csi-provisioner.sock - name: POD_IP valueFrom: fieldRef: fieldPath: status.podIP volumeMounts: - name: socket-dir mountPath: /csi imagePullPolicy: {{ .ImagePullPolicy }} {{ end }} volumes: - name: socket-dir emptyDir: { medium: "Memory" } - name: host-sys hostPath: path: /sys - name: lib-modules hostPath: path: /lib/modules - name: host-dev hostPath: path: /dev - name: ceph-csi-config configMap: name: rook-ceph-csi-config items: - key: csi-cluster-config-json path: config.json - name: keys-tmp-dir emptyDir: { medium: "Memory" } {{ if .MountCustomCephConf }} - name: ceph-config configMap: name: csi-ceph-conf-override items: - key: ceph.conf path: ceph.conf {{ end }}