nfs: add csi-attacher to NFS provisioner
Add attacher sidecar to NFS provisioner pod
to avoid mounting RWO volumes on two nodes
details: https://github.com/rook/rook/issues/10692
Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
(cherry picked from commit 4bdab21db0)
This commit is contained in:
1 parent
5bb14edc73
commit
c6e48823af
7 files changed
+55
-1
No files matched your search
@@ -441,6 +441,12 @@ rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["persistentvolumeclaims/status"]
|
||||
verbs: ["patch"]
|
||||
- apiGroups: ["storage.k8s.io"]
|
||||
resources: ["volumeattachments"]
|
||||
verbs: ["get", "list", "watch", "patch"]
|
||||
- apiGroups: ["storage.k8s.io"]
|
||||
resources: ["volumeattachments/status"]
|
||||
verbs: ["patch"]
|
||||
---
|
||||
# TODO: remove this, once https://github.com/rook/rook/issues/10141
|
||||
# is resolved.
|
||||
|
||||
@@ -378,6 +378,14 @@ csi:
|
||||
limits:
|
||||
memory: 1Gi
|
||||
cpu: 500m
|
||||
- name : csi-attacher
|
||||
resource:
|
||||
requests:
|
||||
memory: 512Mi
|
||||
cpu: 250m
|
||||
limits:
|
||||
memory: 1Gi
|
||||
cpu: 500m
|
||||
|
||||
# -- CEPH CSI NFS plugin resource requirement list
|
||||
# @default -- see values.yaml
|
||||
|
||||
@@ -61,6 +61,12 @@ rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["persistentvolumeclaims/status"]
|
||||
verbs: ["patch"]
|
||||
- apiGroups: ["storage.k8s.io"]
|
||||
resources: ["volumeattachments"]
|
||||
verbs: ["get", "list", "watch", "patch"]
|
||||
- apiGroups: ["storage.k8s.io"]
|
||||
resources: ["volumeattachments/status"]
|
||||
verbs: ["patch"]
|
||||
---
|
||||
# TODO: remove this, once https://github.com/rook/rook/issues/10141
|
||||
# is resolved.
|
||||
|
||||
@@ -517,6 +517,14 @@ data:
|
||||
# limits:
|
||||
# memory: 1Gi
|
||||
# cpu: 500m
|
||||
# - name : csi-attacher
|
||||
# resource:
|
||||
# requests:
|
||||
# memory: 128Mi
|
||||
# cpu: 100m
|
||||
# limits:
|
||||
# memory: 256Mi
|
||||
# cpu: 200m
|
||||
# (Optional) CEPH CSI NFS plugin resource requirement list, Put here list of resource
|
||||
# requests and limits you want to apply for plugin pod
|
||||
# CSI_NFS_PLUGIN_RESOURCE: |
|
||||
|
||||
@@ -445,6 +445,14 @@ data:
|
||||
# limits:
|
||||
# memory: 1Gi
|
||||
# cpu: 500m
|
||||
# - name : csi-attacher
|
||||
# resource:
|
||||
# requests:
|
||||
# memory: 128Mi
|
||||
# cpu: 100m
|
||||
# limits:
|
||||
# memory: 256Mi
|
||||
# cpu: 200m
|
||||
# (Optional) CEPH CSI NFS plugin resource requirement list, Put here list of resource
|
||||
# requests and limits you want to apply for plugin pod
|
||||
# CSI_NFS_PLUGIN_RESOURCE: |
|
||||
|
||||
@@ -656,7 +656,7 @@ func (r *ReconcileCSI) startDrivers(ver *version.Info, ownerInfo *k8sutil.OwnerI
|
||||
}
|
||||
}
|
||||
if EnableNFS {
|
||||
err = csiDriverobj.createCSIDriverInfo(r.opManagerContext, r.context.Clientset, NFSDriverName, k8sutil.GetValue(r.opConfig.Parameters, "CSI_NFS_FSGROUPPOLICY", string(k8scsi.FileFSGroupPolicy)), false)
|
||||
err = csiDriverobj.createCSIDriverInfo(r.opManagerContext, r.context.Clientset, NFSDriverName, k8sutil.GetValue(r.opConfig.Parameters, "CSI_NFS_FSGROUPPOLICY", string(k8scsi.FileFSGroupPolicy)), true)
|
||||
if err != nil {
|
||||
return errors.Wrapf(err, "failed to create CSI driver object for %q", NFSDriverName)
|
||||
}
|
||||
|
||||
@@ -21,6 +21,24 @@ spec:
|
||||
priorityClassName: {{ .ProvisionerPriorityClassName }}
|
||||
{{ end }}
|
||||
containers:
|
||||
- name: csi-attacher
|
||||
image: {{ .AttacherImage }}
|
||||
args:
|
||||
- "--v={{ .SidecarLogLevel }}"
|
||||
- "--csi-address=$(ADDRESS)"
|
||||
- "--leader-election=true"
|
||||
- "--timeout={{ .GRPCTimeout }}"
|
||||
- "--leader-election-namespace={{ .Namespace }}"
|
||||
- "--leader-election-lease-duration=137s"
|
||||
- "--leader-election-renew-deadline=107s"
|
||||
- "--leader-election-retry-period=26s"
|
||||
env:
|
||||
- name: ADDRESS
|
||||
value: /csi/csi-provisioner.sock
|
||||
imagePullPolicy: {{ .ImagePullPolicy }}
|
||||
volumeMounts:
|
||||
- name: socket-dir
|
||||
mountPath: /csi
|
||||
{{ if .EnableNFSSnapshotter }}
|
||||
- name: csi-snapshotter
|
||||
image: {{ .SnapshotterImage }}
|
||||
|
||||
Reference in new issue
Block a user