Skip to content

Commit 14f30dc

Browse files
authored
Merge pull request kubernetes-sigs#444 from Trickybrain/tb-sync
Add default resources values/ security context/ add more flexibility …
2 parents 21163c4 + 83d3273 commit 14f30dc

File tree

6 files changed

+212
-37
lines changed

6 files changed

+212
-37
lines changed

charts/aws-fsx-csi-driver/templates/controller-deployment.yaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ spec:
3939
{{- end }}
4040
containers:
4141
- name: fsx-plugin
42-
image: {{ printf "%s:%s" .Values.image.repository (default (printf "v%s" .Chart.AppVersion) (toString .Values.image.tag)) }}
42+
image: {{ printf "%s%s:%s" (default "" .Values.image.containerRegistry) .Values.image.repository (default (printf "v%s" .Chart.AppVersion) (.Values.image.tag | toString)) }}
4343
imagePullPolicy: {{ .Values.image.pullPolicy }}
4444
args:
4545
- --mode={{ .Values.controller.mode }}
@@ -65,10 +65,10 @@ spec:
6565
name: aws-secret
6666
key: access_key
6767
optional: true
68-
{{- with .Values.controller.region }}
68+
{{- with .Values.controller.region }}
6969
- name: AWS_REGION
7070
value: {{ . }}
71-
{{- end }}
71+
{{- end }}
7272
volumeMounts:
7373
- name: socket-dir
7474
mountPath: /var/lib/csi/sockets/pluginproxy/
@@ -89,7 +89,7 @@ spec:
8989
{{- toYaml . | nindent 12 }}
9090
{{- end }}
9191
- name: csi-provisioner
92-
image: {{ printf "%s:%s" .Values.sidecars.provisioner.image.repository .Values.sidecars.provisioner.image.tag }}
92+
image: {{ printf "%s%s:%s" (default "" .Values.image.containerRegistry) .Values.sidecars.provisioner.image.repository .Values.sidecars.provisioner.image.tag }}
9393
args:
9494
- --csi-address=$(ADDRESS)
9595
- --v={{ .Values.sidecars.provisioner.logLevel }}
@@ -107,7 +107,7 @@ spec:
107107
{{- toYaml . | nindent 12 }}
108108
{{- end }}
109109
- name: csi-resizer
110-
image: {{ printf "%s:%s" .Values.sidecars.resizer.image.repository .Values.sidecars.resizer.image.tag }}
110+
image: {{ printf "%s%s:%s" (default "" .Values.image.containerRegistry) .Values.sidecars.resizer.image.repository .Values.sidecars.resizer.image.tag }}
111111
args:
112112
- --csi-address=$(ADDRESS)
113113
- --v={{ .Values.sidecars.resizer.logLevel }}
@@ -124,7 +124,7 @@ spec:
124124
{{- toYaml . | nindent 12 }}
125125
{{- end }}
126126
- name: liveness-probe
127-
image: {{ printf "%s:%s" .Values.sidecars.livenessProbe.image.repository .Values.sidecars.livenessProbe.image.tag }}
127+
image: {{ printf "%s%s:%s" (default "" .Values.image.containerRegistry) .Values.sidecars.livenessProbe.image.repository .Values.sidecars.livenessProbe.image.tag }}
128128
args:
129129
- --csi-address=/csi/csi.sock
130130
- --health-port=9910
@@ -138,3 +138,11 @@ spec:
138138
volumes:
139139
- name: socket-dir
140140
emptyDir: {}
141+
{{- with .Values.controller.affinity }}
142+
affinity:
143+
{{- toYaml . | nindent 8 }}
144+
{{- end }}
145+
{{- with .Values.controller.topologySpreadConstraints }}
146+
topologySpreadConstraints:
147+
{{- toYaml . | nindent 8 }}
148+
{{- end }}

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ spec:
4040
tolerations:
4141
{{- if .Values.node.tolerateAllTaints }}
4242
- operator: Exists
43-
{{- else }}
44-
{{- with .Values.node.tolerations }}
45-
{{- toYaml . | nindent 8 }}
46-
{{- end }}
43+
{{- else }}
44+
{{- with .Values.node.tolerations }}
45+
{{- toYaml . | nindent 8 }}
46+
{{- end }}
4747
- key: "fsx.csi.aws.com/agent-not-ready"
4848
operator: "Exists"
49-
{{- end }}
49+
{{- end }}
5050
{{- with .Values.node.affinity }}
5151
affinity: {{- toYaml . | nindent 8 }}
5252
{{- end }}
@@ -68,10 +68,10 @@ spec:
6868
valueFrom:
6969
fieldRef:
7070
fieldPath: spec.nodeName
71-
{{- with .Values.node.region }}
71+
{{- with .Values.node.region }}
7272
- name: AWS_REGION
7373
value: {{ . }}
74-
{{- end }}
74+
{{- end }}
7575
volumeMounts:
7676
- name: kubelet-dir
7777
mountPath: /var/lib/kubelet
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{{- if and .Values.controller.podDisruptionBudget.enabled (not .Values.nodeComponentOnly) -}}
2+
apiVersion: policy/v1
3+
kind: PodDisruptionBudget
4+
metadata:
5+
name: fsx-csi-controller
6+
namespace: kube-system
7+
labels:
8+
{{- include "aws-fsx-csi-driver.labels" . | nindent 4 }}
9+
spec:
10+
selector:
11+
matchLabels:
12+
app: fsx-csi-controller
13+
{{- include "aws-fsx-csi-driver.selectorLabels" . | nindent 6 }}
14+
{{- if .Values.controller.podDisruptionBudget.unhealthyPodEvictionPolicy }}
15+
unhealthyPodEvictionPolicy: {{ .Values.controller.podDisruptionBudget.unhealthyPodEvictionPolicy }}
16+
{{- end }}
17+
{{- if le (.Values.controller.replicaCount | int) 2 }}
18+
maxUnavailable: 1
19+
{{- else }}
20+
minAvailable: 2
21+
{{- end }}
22+
{{- end -}}

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

Lines changed: 109 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
image:
66
repository: public.ecr.aws/fsx-csi-driver/aws-fsx-csi-driver
7-
tag: v1.4.0
7+
tag: "v1.4.0"
88
pullPolicy: IfNotPresent
99

1010
csidriver:
@@ -14,37 +14,75 @@ sidecars:
1414
livenessProbe:
1515
image:
1616
repository: public.ecr.aws/eks-distro/kubernetes-csi/livenessprobe
17-
tag: v2.15.0-eks-1-33-3
17+
tag: v2.15.0-eks-1-33-9
1818
pullPolicy: IfNotPresent
19-
resources: {}
19+
resources:
20+
requests:
21+
cpu: 10m
22+
memory: 32Mi
23+
limits:
24+
memory: 128Mi
25+
securityContext:
26+
readOnlyRootFilesystem: true
27+
allowPrivilegeEscalation: false
2028
nodeDriverRegistrar:
2129
image:
2230
repository: public.ecr.aws/eks-distro/kubernetes-csi/node-driver-registrar
23-
tag: v2.13.0-eks-1-33-3
31+
tag: v2.13.0-eks-1-33-9
2432
pullPolicy: IfNotPresent
2533
logLevel: 2
26-
resources: {}
34+
resources:
35+
requests:
36+
cpu: 10m
37+
memory: 32Mi
38+
limits:
39+
memory: 128Mi
40+
securityContext:
41+
readOnlyRootFilesystem: true
42+
allowPrivilegeEscalation: false
2743
provisioner:
2844
image:
2945
repository: public.ecr.aws/eks-distro/kubernetes-csi/external-provisioner
30-
tag: v5.2.0-eks-1-33-3
46+
tag: v5.2.0-eks-1-33-9
3147
pullPolicy: IfNotPresent
3248
logLevel: 2
33-
resources: {}
49+
resources:
50+
requests:
51+
cpu: 10m
52+
memory: 32Mi
53+
limits:
54+
memory: 128Mi
55+
securityContext:
56+
readOnlyRootFilesystem: true
57+
allowPrivilegeEscalation: false
3458
resizer:
3559
image:
3660
repository: public.ecr.aws/eks-distro/kubernetes-csi/external-resizer
37-
tag: v1.13.2-eks-1-33-3
61+
tag: v1.13.2-eks-1-33-9
3862
pullPolicy: IfNotPresent
3963
logLevel: 2
40-
resources: {}
64+
resources:
65+
requests:
66+
cpu: 10m
67+
memory: 32Mi
68+
limits:
69+
memory: 128Mi
70+
securityContext:
71+
readOnlyRootFilesystem: true
72+
allowPrivilegeEscalation: false
4173

4274
controller:
4375
mode: controller
4476
loggingFormat: text
4577
nodeSelector: {}
4678
replicaCount: 2
47-
resources: {}
79+
#If you do want to specify resources, uncomment the following lines, adjust them as necessary
80+
resources:
81+
requests:
82+
cpu: 10m
83+
memory: 40Mi
84+
limits:
85+
memory: 256Mi
4886
serviceAccount:
4987
# Specifies whether a service account should be created
5088
create: true
@@ -65,13 +103,54 @@ controller:
65103
- effect: NoExecute
66104
operator: Exists
67105
tolerationSeconds: 300
106+
# securityContext on the controller pod
107+
securityContext:
108+
runAsNonRoot: false
109+
runAsUser: 0
110+
runAsGroup: 0
111+
fsGroup: 0
112+
# securityContext on the controller container
113+
# Setting privileged=false will cause the "delete-access-point-root-dir" controller option to fail
114+
containerSecurityContext:
115+
privileged: true
116+
leaderElectionRenewDeadline: 10s
117+
leaderElectionLeaseDuration: 15s
118+
affinity:
119+
nodeAffinity:
120+
preferredDuringSchedulingIgnoredDuringExecution:
121+
- weight: 1
122+
preference:
123+
matchExpressions:
124+
- key: eks.amazonaws.com/compute-type
125+
operator: NotIn
126+
values:
127+
- fargate
128+
- hybrid
129+
# topologySpreadConstraints:
130+
# - maxSkew: 1
131+
# topologyKey: topology.kubernetes.io/zone
132+
# whenUnsatisfiable: ScheduleAnyway
133+
# - maxSkew: 1
134+
# topologyKey: kubernetes.io/hostname
135+
# whenUnsatisfiable: ScheduleAnyway
136+
topologySpreadConstraints: []
137+
podDisruptionBudget:
138+
# Warning: Disabling PodDisruptionBudget may lead to delays in stateful workloads starting due to controller
139+
# pod restarts or evictions.
140+
enabled: true
68141

69142
node:
70143
mode: node
71144
loggingFormat: text
72145
logLevel: 2
73146
nodeSelector: {}
74-
resources: {}
147+
#If you do want to specify resources, uncomment the following lines, adjust them as necessary,
148+
resources:
149+
requests:
150+
cpu: 10m
151+
memory: 40Mi
152+
limits:
153+
memory: 256Mi
75154
dnsPolicy: ClusterFirst
76155
dnsConfig:
77156
{}
@@ -87,13 +166,18 @@ node:
87166
# eks.amazonaws.com/role-arn: arn:aws:iam::111122223333:role/fsx-csi-role
88167
name: fsx-csi-node-sa
89168
annotations: {}
169+
healthPort: 9809
170+
# securityContext on the node pod
171+
securityContext:
172+
# The node pod must be run as root to bind to the registration/driver sockets
173+
runAsNonRoot: false
174+
runAsUser: 0
175+
runAsGroup: 0
176+
fsGroup: 0
177+
env: []
178+
volumes: []
179+
volumeMounts: []
90180
podAnnotations: {}
91-
# AWS region to use. If not specified then the region will be looked up via the AWS EC2 metadata
92-
# service.
93-
# ---
94-
# region: us-east-1
95-
region:
96-
terminationGracePeriodSeconds: 30
97181
tolerateAllTaints: true
98182
tolerations:
99183
- operator: Exists
@@ -108,8 +192,15 @@ node:
108192
operator: NotIn
109193
values:
110194
- fargate
111-
195+
- hybrid
196+
112197
nameOverride: ""
113198
fullnameOverride: ""
114199

115200
imagePullSecrets: []
201+
202+
nodeComponentOnly: false
203+
# nodeComponentOnly: true
204+
# Only deploys the node DaemonSet, Skips controller deployment
205+
# nodeComponentOnly: false (default)
206+
# Deploys both controller and node components, normal full deployment

deploy/kubernetes/base/controller-deployment.yaml

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,14 @@ spec:
7171
timeoutSeconds: 3
7272
periodSeconds: 2
7373
failureThreshold: 5
74+
resources:
75+
limits:
76+
memory: 256Mi
77+
requests:
78+
cpu: 10m
79+
memory: 40Mi
7480
- name: csi-provisioner
75-
image: public.ecr.aws/eks-distro/kubernetes-csi/external-provisioner:v5.2.0-eks-1-33-3
81+
image: public.ecr.aws/eks-distro/kubernetes-csi/external-provisioner:v5.2.0-eks-1-33-9
7682
args:
7783
- --csi-address=$(ADDRESS)
7884
- --v=2
@@ -85,8 +91,14 @@ spec:
8591
volumeMounts:
8692
- name: socket-dir
8793
mountPath: /var/lib/csi/sockets/pluginproxy/
94+
resources:
95+
limits:
96+
memory: 128Mi
97+
requests:
98+
cpu: 10m
99+
memory: 32Mi
88100
- name: csi-resizer
89-
image: public.ecr.aws/eks-distro/kubernetes-csi/external-resizer:v1.13.2-eks-1-33-3
101+
image: public.ecr.aws/eks-distro/kubernetes-csi/external-resizer:v1.13.2-eks-1-33-9
90102
args:
91103
- --csi-address=$(ADDRESS)
92104
- --v=2
@@ -98,14 +110,37 @@ spec:
98110
volumeMounts:
99111
- name: socket-dir
100112
mountPath: /var/lib/csi/sockets/pluginproxy/
113+
resources:
114+
limits:
115+
memory: 128Mi
116+
requests:
117+
cpu: 10m
118+
memory: 32Mi
101119
- name: liveness-probe
102-
image: public.ecr.aws/eks-distro/kubernetes-csi/livenessprobe:v2.15.0-eks-1-33-3
120+
image: public.ecr.aws/eks-distro/kubernetes-csi/livenessprobe:v2.15.0-eks-1-33-9
103121
args:
104122
- --csi-address=/csi/csi.sock
105123
- --health-port=9910
106124
volumeMounts:
107125
- name: socket-dir
108126
mountPath: /csi
127+
resources:
128+
limits:
129+
memory: 128Mi
130+
requests:
131+
cpu: 10m
132+
memory: 32Mi
109133
volumes:
110134
- name: socket-dir
111135
emptyDir: {}
136+
affinity:
137+
nodeAffinity:
138+
preferredDuringSchedulingIgnoredDuringExecution:
139+
- preference:
140+
matchExpressions:
141+
- key: eks.amazonaws.com/compute-type
142+
operator: NotIn
143+
values:
144+
- fargate
145+
- hybrid
146+
weight: 1

0 commit comments

Comments
 (0)