Skip to content

Commit 987eea1

Browse files
authored
Merge pull request #1739 from dankova22/patch-perms
Add opt-in parameter to disable node mutation permissions
2 parents aba4366 + 4edb136 commit 987eea1

File tree

5 files changed

+23
-2
lines changed

5 files changed

+23
-2
lines changed

charts/aws-efs-csi-driver/templates/node-daemonset.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ spec:
9696
- name: AWS_USE_FIPS_ENDPOINT
9797
value: "true"
9898
{{- end }}
99+
{{- if .Values.node.serviceAccount.disableMutation }}
100+
- name: DISABLE_TAINT_WATCHER
101+
value: "true"
102+
{{- end }}
99103
- name: PORT_RANGE_UPPER_BOUND
100104
value: "{{ .Values.portRangeUpperBound }}"
101105
{{- with .Values.node.env }}

charts/aws-efs-csi-driver/templates/node-serviceaccount.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ metadata:
2121
rules:
2222
- apiGroups: [""]
2323
resources: ["nodes"]
24-
verbs: ["get", "list", "watch", "patch"]
24+
verbs: ["get", "list", "watch"]
25+
{{- if not .Values.node.serviceAccount.disableMutation }}
26+
- apiGroups: [""]
27+
resources: ["nodes"]
28+
verbs: ["patch"]
29+
{{- end }}
2530
---
2631
kind: ClusterRoleBinding
2732
apiVersion: rbac.authorization.k8s.io/v1

charts/aws-efs-csi-driver/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,10 @@ node:
207207
annotations: {}
208208
## Enable if EKS IAM for SA is used
209209
# eks.amazonaws.com/role-arn: arn:aws:iam::111122223333:role/efs-csi-role
210+
# Disable mutating permissions for the node service account.
211+
# When disableMutation is true, some features of the EFS CSI Driver node pods will not function, such as taint removal.
212+
# Primarily useful in particularly security-sensitive environments, or on multi-tenant clusters that isolate tenants by node.
213+
disableMutation: false
210214
healthPort: 9809
211215
# securityContext on the node pod
212216
securityContext:

deploy/kubernetes/base/node-serviceaccount.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ metadata:
1616
rules:
1717
- apiGroups: [""]
1818
resources: ["nodes"]
19-
verbs: ["get", "list", "watch", "patch"]
19+
verbs: ["get", "list", "watch"]
20+
- apiGroups: [""]
21+
resources: ["nodes"]
22+
verbs: ["patch"]
2023
---
2124
kind: ClusterRoleBinding
2225
apiVersion: rbac.authorization.k8s.io/v1

pkg/driver/node.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,11 @@ type JSONPatch struct {
497497
// This taint can be optionally applied by users to prevent startup race conditions such as
498498
// https://github.com/kubernetes/kubernetes/issues/95911
499499
func removeNotReadyTaint(k8sClient cloud.KubernetesAPIClient) error {
500+
if os.Getenv("DISABLE_TAINT_WATCHER") != "" {
501+
klog.V(4).InfoS("DISABLE_TAINT_WATCHER set, skipping taint removal")
502+
return nil
503+
}
504+
500505
nodeName := os.Getenv("CSI_NODE_NAME")
501506
if nodeName == "" {
502507
klog.V(4).InfoS("CSI_NODE_NAME missing, skipping taint removal")

0 commit comments

Comments
 (0)