kind: Deployment apiVersion: apps/v1 metadata: name: csi-rbdplugin-provisioner namespace: {{ .Namespace }} spec: replicas: {{ .ProvisionerReplicas }} selector: matchLabels: app: csi-rbdplugin-provisioner template: metadata: labels: app: csi-rbdplugin-provisioner contains: csi-rbdplugin-metrics {{ range $key, $value := .CSIRBDPodLabels }} {{ $key }}: "{{ $value }}" {{ end }} spec: serviceAccountName: rook-csi-rbd-provisioner-sa {{ if .ProvisionerPriorityClassName }} priorityClassName: {{ .ProvisionerPriorityClassName }} {{ end }} containers: - name: csi-provisioner image: {{ .ProvisionerImage }} args: - "--csi-address=$(ADDRESS)" - "--v={{ .SidecarLogLevel }}" - "--timeout={{ .GRPCTimeout }}" - "--retry-interval-start=500ms" - "--leader-election=true" - "--leader-election-namespace={{ .Namespace }}" - "--leader-election-lease-duration=137s" - "--leader-election-renew-deadline=107s" - "--leader-election-retry-period=26s" - "--default-fstype=ext4" - "--extra-create-metadata=true" {{- if .EnableCSITopology }} - "--feature-gates=Topology=true" {{- end }} env: - name: ADDRESS value: unix:///csi/csi-provisioner.sock imagePullPolicy: {{ .ImagePullPolicy }} volumeMounts: - name: socket-dir mountPath: /csi - name: csi-resizer image: {{ .ResizerImage }} args: - "--csi-address=$(ADDRESS)" - "--v={{ .SidecarLogLevel }}" - "--timeout={{ .GRPCTimeout }}" - "--leader-election=true" - "--leader-election-namespace={{ .Namespace }}" - "--leader-election-lease-duration=137s" - "--leader-election-renew-deadline=107s" - "--leader-election-retry-period=26s" - "--handle-volume-inuse-error=false" env: - name: ADDRESS value: unix:///csi/csi-provisioner.sock imagePullPolicy: {{ .ImagePullPolicy }} volumeMounts: - name: socket-dir mountPath: /csi {{ if .RBDAttachRequired }} - name: csi-attacher image: {{ .AttacherImage }} args: - "--v={{ .SidecarLogLevel }}" - "--timeout={{ .GRPCTimeout }}" - "--csi-address=$(ADDRESS)" - "--leader-election=true" - "--leader-election-namespace={{ .Namespace }}" - "--leader-election-lease-duration=137s" - "--leader-election-renew-deadline=107s" - "--leader-election-retry-period=26s" - "--default-fstype=ext4" env: - name: ADDRESS value: /csi/csi-provisioner.sock imagePullPolicy: {{ .ImagePullPolicy }} volumeMounts: - name: socket-dir mountPath: /csi {{ end }} {{ if .EnableRBDSnapshotter }} - name: csi-snapshotter image: {{ .SnapshotterImage }} args: - "--csi-address=$(ADDRESS)" - "--v={{ .SidecarLogLevel }}" - "--timeout={{ .GRPCTimeout }}" - "--leader-election=true" - "--leader-election-namespace={{ .Namespace }}" - "--leader-election-lease-duration=137s" - "--leader-election-renew-deadline=107s" - "--leader-election-retry-period=26s" - "--extra-create-metadata=true" env: - name: ADDRESS value: unix:///csi/csi-provisioner.sock imagePullPolicy: {{ .ImagePullPolicy }} volumeMounts: - name: socket-dir mountPath: /csi {{ end }} {{ if .EnableOMAPGenerator }} - name: csi-omap-generator image: {{ .CSIPluginImage }} args : - "--type=controller" - "--drivernamespace=$(DRIVER_NAMESPACE)" - "--v={{ .LogLevel }}" - "--drivername={{ .DriverNamePrefix }}rbd.csi.ceph.com" {{ if .CSIEnableMetadata }} - "--setmetadata={{ .CSIEnableMetadata }}" {{ end }} {{ if .CSIClusterName }} - "--clustername={{ .CSIClusterName }}" {{ end }} env: - name: DRIVER_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace imagePullPolicy: {{ .ImagePullPolicy }} volumeMounts: - name: ceph-csi-configs mountPath: /etc/ceph-csi-config/ - name: keys-tmp-dir mountPath: /tmp/csi/keys {{ 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/" 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 }} - name: csi-rbdplugin image: {{ .CSIPluginImage }} args : - "--nodeid=$(NODE_ID)" - "--endpoint=$(CSI_ENDPOINT)" - "--v={{ .LogLevel }}" - "--type=rbd" - "--controllerserver=true" - "--drivername={{ .DriverNamePrefix }}rbd.csi.ceph.com" - "--pidlimit=-1" {{ if .EnableCSIAddonsSideCar }} - "--csi-addons-endpoint=$(CSIADDONS_ENDPOINT)" {{ end }} {{ if .CSIEnableMetadata }} - "--setmetadata={{ .CSIEnableMetadata }}" {{ end }} {{ if .CSIClusterName }} - "--clustername={{ .CSIClusterName }}" {{ 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 - mountPath: /dev name: host-dev - mountPath: /sys name: host-sys - mountPath: /lib/modules name: lib-modules readOnly: true - name: ceph-csi-configs 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 }} - name: oidc-token mountPath: /run/secrets/tokens readOnly: true {{ if .EnableCSIEncryption }} - name: rook-ceph-csi-kms-config mountPath: /etc/ceph-csi-encryption-kms-config/ {{ end }} {{ if .EnableLiveness }} - name: liveness-prometheus image: {{ .CSIPluginImage }} args: - "--type=liveness" - "--endpoint=$(CSI_ENDPOINT)" - "--metricsport={{ .RBDLivenessMetricsPort }}" - "--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: host-dev hostPath: path: /dev - name: host-sys hostPath: path: /sys - name: lib-modules hostPath: path: /lib/modules - name: socket-dir emptyDir: { medium: "Memory" } - name: ceph-csi-configs projected: sources: - name: ceph-csi-config configMap: name: rook-ceph-csi-config items: - key: csi-cluster-config-json path: config.json - name: ceph-csi-mapping-config configMap: name: rook-ceph-csi-mapping-config items: - key: csi-mapping-config-json path: cluster-mapping.json {{ if .MountCustomCephConf }} - name: ceph-config configMap: name: csi-ceph-conf-override items: - key: ceph.conf path: ceph.conf {{ end }} - name: keys-tmp-dir emptyDir: { medium: "Memory" } - name: oidc-token projected: sources: - serviceAccountToken: path: oidc-token expirationSeconds: 3600 audience: ceph-csi-kms {{ if .EnableCSIEncryption }} - name: rook-ceph-csi-kms-config configMap: name: rook-ceph-csi-kms-config items: - key: config.json path: config.json {{ end }}