Files
my-rook-config/pkg/operator/ceph/csi/template/rbd/csi-rbdplugin-holder.yaml
T
Madhu Rajanna 32943b64e3 csi: add missing serviceAccoutName to holder
Add missing serviceAccountName for the holder
daemonset to create the pods with required
access.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
2022-09-02 13:20:47 +05:30

65 lines
2.5 KiB
YAML

# 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 network RBD block mapping 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 mapping an RBD
# image, 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-rbdplugin-holder
namespace: {{ .Namespace }}
spec:
selector:
matchLabels:
app: csi-rbdplugin-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-rbdplugin-holder
{{ range $key, $value := .CSIRBDPodLabels }}
{{ $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-rbd-plugin-sa
{{ if .PluginPriorityClassName }}
priorityClassName: {{ .PluginPriorityClassName }}
{{ end }}
containers:
- name: csi-rbdplugin-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