Skip to content

Commit 84c0bc3

Browse files
committed
E2E test for EFS support
1 parent 2082599 commit 84c0bc3

File tree

10 files changed

+779
-0
lines changed

10 files changed

+779
-0
lines changed

test/e2e/data/e2e_conf.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ providers:
207207
value: ../../../config/default
208208
contract: v1beta1
209209
files:
210+
- sourcePath: "./infrastructure-aws/generated/cluster-template-efs-support.yaml"
210211
- sourcePath: "./infrastructure-aws/generated/cluster-template-external-csi.yaml"
211212
- sourcePath: "./infrastructure-aws/generated/cluster-template-csimigration-off.yaml"
212213
- sourcePath: "./infrastructure-aws/generated/cluster-template-external-cloud-provider.yaml"
Lines changed: 334 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,334 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
labels:
5+
app.kubernetes.io/name: aws-efs-csi-driver
6+
name: efs-csi-controller-sa
7+
namespace: kube-system
8+
---
9+
apiVersion: v1
10+
kind: ServiceAccount
11+
metadata:
12+
labels:
13+
app.kubernetes.io/name: aws-efs-csi-driver
14+
name: efs-csi-node-sa
15+
namespace: kube-system
16+
---
17+
apiVersion: rbac.authorization.k8s.io/v1
18+
kind: ClusterRole
19+
metadata:
20+
labels:
21+
app.kubernetes.io/name: aws-efs-csi-driver
22+
name: efs-csi-external-provisioner-role
23+
rules:
24+
- apiGroups:
25+
- ""
26+
resources:
27+
- persistentvolumes
28+
verbs:
29+
- get
30+
- list
31+
- watch
32+
- create
33+
- delete
34+
- apiGroups:
35+
- ""
36+
resources:
37+
- persistentvolumeclaims
38+
verbs:
39+
- get
40+
- list
41+
- watch
42+
- update
43+
- apiGroups:
44+
- storage.k8s.io
45+
resources:
46+
- storageclasses
47+
verbs:
48+
- get
49+
- list
50+
- watch
51+
- apiGroups:
52+
- ""
53+
resources:
54+
- events
55+
verbs:
56+
- list
57+
- watch
58+
- create
59+
- patch
60+
- apiGroups:
61+
- storage.k8s.io
62+
resources:
63+
- csinodes
64+
verbs:
65+
- get
66+
- list
67+
- watch
68+
- apiGroups:
69+
- ""
70+
resources:
71+
- nodes
72+
verbs:
73+
- get
74+
- list
75+
- watch
76+
- apiGroups:
77+
- coordination.k8s.io
78+
resources:
79+
- leases
80+
verbs:
81+
- get
82+
- watch
83+
- list
84+
- delete
85+
- update
86+
- create
87+
- apiGroups:
88+
- ""
89+
resources:
90+
- secrets
91+
verbs:
92+
- get
93+
- watch
94+
- list
95+
---
96+
apiVersion: rbac.authorization.k8s.io/v1
97+
kind: ClusterRoleBinding
98+
metadata:
99+
labels:
100+
app.kubernetes.io/name: aws-efs-csi-driver
101+
name: efs-csi-provisioner-binding
102+
roleRef:
103+
apiGroup: rbac.authorization.k8s.io
104+
kind: ClusterRole
105+
name: efs-csi-external-provisioner-role
106+
subjects:
107+
- kind: ServiceAccount
108+
name: efs-csi-controller-sa
109+
namespace: kube-system
110+
---
111+
apiVersion: apps/v1
112+
kind: Deployment
113+
metadata:
114+
labels:
115+
app.kubernetes.io/name: aws-efs-csi-driver
116+
name: efs-csi-controller
117+
namespace: kube-system
118+
spec:
119+
replicas: 2
120+
selector:
121+
matchLabels:
122+
app: efs-csi-controller
123+
app.kubernetes.io/instance: kustomize
124+
app.kubernetes.io/name: aws-efs-csi-driver
125+
template:
126+
metadata:
127+
labels:
128+
app: efs-csi-controller
129+
app.kubernetes.io/instance: kustomize
130+
app.kubernetes.io/name: aws-efs-csi-driver
131+
spec:
132+
containers:
133+
- args:
134+
- --endpoint=$(CSI_ENDPOINT)
135+
- --logtostderr
136+
- --v=2
137+
- --delete-access-point-root-dir=false
138+
env:
139+
- name: CSI_ENDPOINT
140+
value: unix:///var/lib/csi/sockets/pluginproxy/csi.sock
141+
image: amazon/aws-efs-csi-driver:v1.3.6
142+
imagePullPolicy: IfNotPresent
143+
livenessProbe:
144+
failureThreshold: 5
145+
httpGet:
146+
path: /healthz
147+
port: healthz
148+
initialDelaySeconds: 10
149+
periodSeconds: 10
150+
timeoutSeconds: 3
151+
name: efs-plugin
152+
ports:
153+
- containerPort: 9909
154+
name: healthz
155+
protocol: TCP
156+
securityContext:
157+
privileged: true
158+
volumeMounts:
159+
- mountPath: /var/lib/csi/sockets/pluginproxy/
160+
name: socket-dir
161+
- args:
162+
- --csi-address=$(ADDRESS)
163+
- --v=2
164+
- --feature-gates=Topology=true
165+
- --extra-create-metadata
166+
- --leader-election
167+
env:
168+
- name: ADDRESS
169+
value: /var/lib/csi/sockets/pluginproxy/csi.sock
170+
image: public.ecr.aws/eks-distro/kubernetes-csi/external-provisioner:v2.1.1-eks-1-18-2
171+
imagePullPolicy: IfNotPresent
172+
name: csi-provisioner
173+
volumeMounts:
174+
- mountPath: /var/lib/csi/sockets/pluginproxy/
175+
name: socket-dir
176+
- args:
177+
- --csi-address=/csi/csi.sock
178+
- --health-port=9909
179+
image: public.ecr.aws/eks-distro/kubernetes-csi/livenessprobe:v2.2.0-eks-1-18-2
180+
imagePullPolicy: IfNotPresent
181+
name: liveness-probe
182+
volumeMounts:
183+
- mountPath: /csi
184+
name: socket-dir
185+
hostNetwork: true
186+
nodeSelector:
187+
kubernetes.io/os: linux
188+
priorityClassName: system-cluster-critical
189+
serviceAccountName: efs-csi-controller-sa
190+
volumes:
191+
- emptyDir: {}
192+
name: socket-dir
193+
---
194+
apiVersion: apps/v1
195+
kind: DaemonSet
196+
metadata:
197+
labels:
198+
app.kubernetes.io/name: aws-efs-csi-driver
199+
name: efs-csi-node
200+
namespace: kube-system
201+
spec:
202+
selector:
203+
matchLabels:
204+
app: efs-csi-node
205+
app.kubernetes.io/instance: kustomize
206+
app.kubernetes.io/name: aws-efs-csi-driver
207+
template:
208+
metadata:
209+
labels:
210+
app: efs-csi-node
211+
app.kubernetes.io/instance: kustomize
212+
app.kubernetes.io/name: aws-efs-csi-driver
213+
spec:
214+
affinity:
215+
nodeAffinity:
216+
requiredDuringSchedulingIgnoredDuringExecution:
217+
nodeSelectorTerms:
218+
- matchExpressions:
219+
- key: eks.amazonaws.com/compute-type
220+
operator: NotIn
221+
values:
222+
- fargate
223+
containers:
224+
- args:
225+
- --endpoint=$(CSI_ENDPOINT)
226+
- --logtostderr
227+
- --v=2
228+
env:
229+
- name: CSI_ENDPOINT
230+
value: unix:/csi/csi.sock
231+
image: amazon/aws-efs-csi-driver:v1.3.6
232+
imagePullPolicy: IfNotPresent
233+
livenessProbe:
234+
failureThreshold: 5
235+
httpGet:
236+
path: /healthz
237+
port: healthz
238+
initialDelaySeconds: 10
239+
periodSeconds: 2
240+
timeoutSeconds: 3
241+
name: efs-plugin
242+
ports:
243+
- containerPort: 9809
244+
name: healthz
245+
protocol: TCP
246+
securityContext:
247+
privileged: true
248+
volumeMounts:
249+
- mountPath: /var/lib/kubelet
250+
mountPropagation: Bidirectional
251+
name: kubelet-dir
252+
- mountPath: /csi
253+
name: plugin-dir
254+
- mountPath: /var/run/efs
255+
name: efs-state-dir
256+
- mountPath: /var/amazon/efs
257+
name: efs-utils-config
258+
- mountPath: /etc/amazon/efs-legacy
259+
name: efs-utils-config-legacy
260+
- args:
261+
- --csi-address=$(ADDRESS)
262+
- --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)
263+
- --v=2
264+
env:
265+
- name: ADDRESS
266+
value: /csi/csi.sock
267+
- name: DRIVER_REG_SOCK_PATH
268+
value: /var/lib/kubelet/plugins/efs.csi.aws.com/csi.sock
269+
- name: KUBE_NODE_NAME
270+
valueFrom:
271+
fieldRef:
272+
fieldPath: spec.nodeName
273+
image: public.ecr.aws/eks-distro/kubernetes-csi/node-driver-registrar:v2.1.0-eks-1-18-2
274+
imagePullPolicy: IfNotPresent
275+
name: csi-driver-registrar
276+
volumeMounts:
277+
- mountPath: /csi
278+
name: plugin-dir
279+
- mountPath: /registration
280+
name: registration-dir
281+
- args:
282+
- --csi-address=/csi/csi.sock
283+
- --health-port=9809
284+
- --v=2
285+
image: public.ecr.aws/eks-distro/kubernetes-csi/livenessprobe:v2.2.0-eks-1-18-2
286+
imagePullPolicy: IfNotPresent
287+
name: liveness-probe
288+
volumeMounts:
289+
- mountPath: /csi
290+
name: plugin-dir
291+
dnsPolicy: ClusterFirst
292+
hostNetwork: true
293+
nodeSelector:
294+
beta.kubernetes.io/os: linux
295+
priorityClassName: system-node-critical
296+
serviceAccountName: efs-csi-node-sa
297+
tolerations:
298+
- operator: Exists
299+
volumes:
300+
- hostPath:
301+
path: /var/lib/kubelet
302+
type: Directory
303+
name: kubelet-dir
304+
- hostPath:
305+
path: /var/lib/kubelet/plugins/efs.csi.aws.com/
306+
type: DirectoryOrCreate
307+
name: plugin-dir
308+
- hostPath:
309+
path: /var/lib/kubelet/plugins_registry/
310+
type: Directory
311+
name: registration-dir
312+
- hostPath:
313+
path: /var/run/efs
314+
type: DirectoryOrCreate
315+
name: efs-state-dir
316+
- hostPath:
317+
path: /var/amazon/efs
318+
type: DirectoryOrCreate
319+
name: efs-utils-config
320+
- hostPath:
321+
path: /etc/amazon/efs
322+
type: DirectoryOrCreate
323+
name: efs-utils-config-legacy
324+
---
325+
apiVersion: storage.k8s.io/v1
326+
kind: CSIDriver
327+
metadata:
328+
annotations:
329+
helm.sh/hook: pre-install, pre-upgrade
330+
helm.sh/hook-delete-policy: before-hook-creation
331+
helm.sh/resource-policy: keep
332+
name: efs.csi.aws.com
333+
spec:
334+
attachRequired: false
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: addons.cluster.x-k8s.io/v1beta1
2+
kind: ClusterResourceSet
3+
metadata:
4+
name: crs-csi
5+
spec:
6+
strategy: "ApplyOnce"
7+
clusterSelector:
8+
matchLabels:
9+
csi: external
10+
resources:
11+
- name: aws-efs-csi-driver-addon
12+
kind: ConfigMap
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
resources:
2+
- ../limit-az
3+
- csi-resource-set.yaml
4+
patchesStrategicMerge:
5+
- patches/efs-support.yaml
6+
configMapGenerator:
7+
- name: aws-efs-csi-driver-addon
8+
files:
9+
- aws-efs-csi-external.yaml
10+
generatorOptions:
11+
disableNameSuffixHash: true
12+
labels:
13+
type: generated
14+
annotations:
15+
note: generated
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
apiVersion: cluster.x-k8s.io/v1beta1
3+
kind: Cluster
4+
metadata:
5+
name: ${CLUSTER_NAME}
6+
labels:
7+
csi: "external"
8+
---
9+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
10+
kind: AWSMachineTemplate
11+
metadata:
12+
name: "${CLUSTER_NAME}-md-0"
13+
spec:
14+
template:
15+
spec:
16+
rootVolume:
17+
size: 16

0 commit comments

Comments
 (0)