# This DaemonSet is only active when the cluster is deployed with Multus enabled or EnableCSIHostNetwork # is set to false. Hopefully in the future it will be part of every Ceph-CSI deployment. Its role is to # "hold" the Ceph Filesystem mounts that are created by the CSI driver. Essentially, it exposes its # network namespace into the Kubelet plugin directly and Ceph-CSI picks it up. When mounting, the Ceph-CSI # driver will use the network namespace of the DaemonSet instead of its own (the plugin pod). This pod # is not expected to be updated nor restarted unless the node reboots. kind: DaemonSet apiVersion: apps/v1 metadata: name: csi-cephfsplugin-holder namespace: {{ .Namespace }} spec: selector: matchLabels: app: csi-cephfsplugin-holder updateStrategy: # DO NOT CHANGE THE STRATEGY # The pod is not supposed to be restarted on updates, it should never receive updates too. # If it does then the connectivity to the Ceph cluster will be lost and the client I/O will # fail. type: OnDelete template: metadata: labels: app: csi-cephfsplugin-holder {{ range $key, $value := .CSICephFSPodLabels }} {{ $key }}: "{{ $value }}" {{ end }} spec: # HostPID is needed to expose the correct process ID network namespace and not the process namespace hostPID: true serviceAccountName: rook-csi-cephfs-plugin-sa {{ if .PluginPriorityClassName }} priorityClassName: {{ .PluginPriorityClassName }} {{ end }} containers: - name: csi-cephfsplugin-holder # This is necessary for the Bidirectional mount propagation securityContext: privileged: true image: {{ .CSIPluginImage }} command: - "/bin/sh" - "-c" # the third $ allows the "$$" to be interpreted so it can return the current bash process ID args: - "ln --force --symbolic --verbose /proc/$$$/ns/net {{ .KubeletDirPath }}/plugins/$ROOK_CEPH_CSI_DRIVER_NAME/$CEPH_CLUSTER_NAMESPACE.net.ns && sleep infinity" volumeMounts: - name: plugin-mount-dir mountPath: "{{ .KubeletDirPath }}/plugins" mountPropagation: "Bidirectional" volumes: - name: plugin-mount-dir hostPath: path: "{{ .KubeletDirPath }}/plugins" type: Directory