Skip to content

Commit abe39ac

Browse files
authored
Merge pull request #9008 from zalando-incubator/e2e-for-both-providers
Run e2e tests for both `zalando-aws` and `zalando-eks` providers.
2 parents 14fcb3b + 9c4de5d commit abe39ac

File tree

5 files changed

+246
-26
lines changed

5 files changed

+246
-26
lines changed

cluster/cluster.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ Resources:
330330
AWS: !Sub "arn:aws:iam::${AWS::AccountId}:root"
331331
Version: 2012-10-17
332332
Path: /
333-
RoleName: "{{.Cluster.LocalID}}-e2e-eks-iam-test-postgres-administrator-role"
333+
RoleName: "{{.Cluster.LocalID}}-e2e-eks-iam-test-postgres-admin-role"
334334
Type: 'AWS::IAM::Role'
335335
E2EEKSIAMTestAccessEntryPostgresAdministrator:
336336
Type: "AWS::EKS::AccessEntry"

delivery.yaml

Lines changed: 227 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pipeline:
3535
IMAGE=container-registry-test.zalando.net/teapot/kubernetes-on-aws-e2e
3636
IMAGE=$IMAGE VERSION=$CDP_BUILD_VERSION make build.push.multiarch
3737
38-
- id: create-cluster
38+
- id: create-cluster-aws
3939
when:
4040
event: pull_request
4141
depends_on:
@@ -46,7 +46,7 @@ pipeline:
4646
process: microservice_standard_test
4747
config:
4848
apply_manifests:
49-
env: &apply_env
49+
env: &apply_env_aws
5050
- name: DEPLOYMENT_PATH
5151
value: test/e2e
5252
- name: IAM_ROLE_ARN
@@ -55,6 +55,10 @@ pipeline:
5555
value: kubernetes
5656
- name: COMPONENT
5757
value: e2e
58+
- name: CLUSTER_PROVIDER
59+
value: zalando-aws
60+
- name: E2E_SKIP_CLUSTER_UPDATE
61+
value: "false"
5862
end2end_tests:
5963
metadata:
6064
name: e2e
@@ -81,9 +85,15 @@ pipeline:
8185
- name: ETCD_ENDPOINTS
8286
value: "https://etcd-server.etcd.teapot-e2e.zalan.do:2479"
8387
- name: CLUSTER_PROVIDER
84-
value: "zalando-eks"
88+
valueFrom:
89+
configMapKeyRef:
90+
name: kubernetes-e2e-config
91+
key: "CLUSTER_PROVIDER"
8592
- name: E2E_SKIP_CLUSTER_UPDATE
86-
value: "true"
93+
valueFrom:
94+
configMapKeyRef:
95+
name: kubernetes-e2e-config
96+
key: "E2E_SKIP_CLUSTER_UPDATE"
8797
- name: SKIPPER_OPA_ENABLED
8898
value: "true"
8999
- name: HOSTED_ZONE
@@ -199,18 +209,217 @@ pipeline:
199209
cpu: 500m
200210
memory: 2Gi
201211

202-
- id: e2e-tests
212+
- id: e2e-tests-aws
213+
when:
214+
event: pull_request
215+
depends_on:
216+
- create-cluster-aws
217+
type: process
218+
desc: "Kubernetes e2e tests"
219+
target: stups-test
220+
process: microservice_standard_test
221+
config:
222+
apply_manifests:
223+
env: *apply_env_aws
224+
end2end_tests:
225+
metadata:
226+
name: e2e
227+
labels:
228+
application: kubernetes
229+
component: e2e
230+
annotations:
231+
zalando.org/runtime-policy: require-on-demand
232+
spec:
233+
serviceAccountName: kubernetes-e2e
234+
restartPolicy: Never
235+
containers:
236+
- name: e2e
237+
image: "container-registry-test.zalando.net/teapot/kubernetes-on-aws-e2e:#{CDP_BUILD_VERSION}"
238+
args:
239+
- e2e
240+
env: *e2e_env
241+
resources:
242+
limits:
243+
cpu: 2
244+
memory: 8Gi
245+
requests:
246+
cpu: 2
247+
memory: 8Gi
248+
249+
- id: e2e-load-test-result-aws
250+
when:
251+
event: pull_request
252+
depends_on:
253+
- create-cluster-aws
254+
type: process
255+
desc: "Kubernetes e2e load tests"
256+
target: stups-test
257+
process: microservice_standard_test
258+
config:
259+
apply_manifests:
260+
env: *apply_env_aws
261+
end2end_tests:
262+
metadata:
263+
name: e2e
264+
labels:
265+
application: kubernetes
266+
component: e2e
267+
annotations:
268+
zalando.org/runtime-policy: require-on-demand
269+
spec:
270+
serviceAccountName: kubernetes-e2e
271+
restartPolicy: Never
272+
containers:
273+
- name: e2e
274+
image: "container-registry-test.zalando.net/teapot/kubernetes-on-aws-e2e:#{CDP_BUILD_VERSION}"
275+
args:
276+
- loadtest-e2e
277+
env: *e2e_env
278+
resources:
279+
limits:
280+
cpu: 1000m
281+
memory: 1000Mi
282+
requests:
283+
cpu: 1000m
284+
memory: 1000Mi
285+
286+
- id: stackset-e2e-tests-aws
287+
when:
288+
event: pull_request
289+
depends_on:
290+
- create-cluster-aws
291+
type: process
292+
desc: "StackSet e2e tests"
293+
target: stups-test
294+
process: microservice_standard_test
295+
config:
296+
apply_manifests:
297+
env: *apply_env_aws
298+
end2end_tests:
299+
metadata:
300+
name: e2e
301+
labels:
302+
application: kubernetes
303+
component: e2e
304+
annotations:
305+
zalando.org/runtime-policy: require-on-demand
306+
spec:
307+
serviceAccountName: kubernetes-e2e
308+
restartPolicy: Never
309+
containers:
310+
- name: e2e
311+
image: "container-registry-test.zalando.net/teapot/kubernetes-on-aws-e2e:#{CDP_BUILD_VERSION}"
312+
args:
313+
- stackset-e2e
314+
env: *e2e_env
315+
resources:
316+
limits:
317+
cpu: 2
318+
memory: 1Gi
319+
requests:
320+
cpu: 2
321+
memory: 1Gi
322+
323+
- id: decommission-cluster-aws
324+
when:
325+
event: pull_request
326+
depends_on:
327+
- e2e-tests-aws
328+
- stackset-e2e-tests-aws
329+
- e2e-load-test-result-aws
330+
type: process
331+
desc: "Decommission cluster used for Kubernetes e2e tests"
332+
target: stups-test
333+
process: microservice_standard_test
334+
config:
335+
apply_manifests:
336+
env: *apply_env_aws
337+
end2end_tests:
338+
metadata:
339+
name: e2e
340+
labels:
341+
application: kubernetes
342+
component: e2e
343+
annotations:
344+
zalando.org/runtime-policy: require-on-demand
345+
spec:
346+
serviceAccountName: kubernetes-e2e
347+
restartPolicy: Never
348+
containers:
349+
- name: e2e
350+
image: "container-registry-test.zalando.net/teapot/kubernetes-on-aws-e2e:#{CDP_BUILD_VERSION}"
351+
args:
352+
- decommission-cluster
353+
env: *e2e_env
354+
resources:
355+
limits:
356+
cpu: 500m
357+
memory: 1Gi
358+
requests:
359+
cpu: 500m
360+
memory: 1Gi
361+
362+
- id: create-cluster-eks
363+
when:
364+
event: pull_request
365+
depends_on:
366+
- build
367+
type: process
368+
desc: "Create cluster for Kubernetes e2e tests"
369+
target: stups-test
370+
process: microservice_standard_test
371+
config:
372+
apply_manifests:
373+
env: &apply_env_eks
374+
- name: DEPLOYMENT_PATH
375+
value: test/e2e
376+
- name: IAM_ROLE_ARN
377+
value: "arn:aws:iam::925511348110:role/cluster-lifecycle-manager-entrypoint"
378+
- name: APPLICATION
379+
value: kubernetes
380+
- name: COMPONENT
381+
value: e2e
382+
- name: CLUSTER_PROVIDER
383+
value: zalando-eks
384+
- name: E2E_SKIP_CLUSTER_UPDATE
385+
value: "true"
386+
end2end_tests:
387+
metadata:
388+
name: e2e
389+
labels:
390+
application: kubernetes
391+
component: e2e
392+
annotations:
393+
zalando.org/runtime-policy: require-on-demand
394+
spec:
395+
serviceAccountName: kubernetes-e2e
396+
restartPolicy: Never
397+
containers:
398+
- name: e2e
399+
image: "container-registry-test.zalando.net/teapot/kubernetes-on-aws-e2e:#{CDP_BUILD_VERSION}"
400+
args:
401+
- create-cluster
402+
env: *e2e_env
403+
resources:
404+
limits:
405+
cpu: 500m
406+
memory: 2Gi
407+
requests:
408+
cpu: 500m
409+
memory: 2Gi
410+
411+
- id: e2e-tests-eks
203412
when:
204413
event: pull_request
205414
depends_on:
206-
- create-cluster
415+
- create-cluster-eks
207416
type: process
208417
desc: "Kubernetes e2e tests"
209418
target: stups-test
210419
process: microservice_standard_test
211420
config:
212421
apply_manifests:
213-
env: *apply_env
422+
env: *apply_env_eks
214423
end2end_tests:
215424
metadata:
216425
name: e2e
@@ -236,18 +445,18 @@ pipeline:
236445
cpu: 2
237446
memory: 8Gi
238447

239-
- id: e2e-load-test-result
448+
- id: e2e-load-test-result-eks
240449
when:
241450
event: pull_request
242451
depends_on:
243-
- create-cluster
452+
- create-cluster-eks
244453
type: process
245454
desc: "Kubernetes e2e load tests"
246455
target: stups-test
247456
process: microservice_standard_test
248457
config:
249458
apply_manifests:
250-
env: *apply_env
459+
env: *apply_env_eks
251460
end2end_tests:
252461
metadata:
253462
name: e2e
@@ -273,18 +482,18 @@ pipeline:
273482
cpu: 1000m
274483
memory: 1000Mi
275484

276-
- id: stackset-e2e-tests
485+
- id: stackset-e2e-tests-eks
277486
when:
278487
event: pull_request
279488
depends_on:
280-
- create-cluster
489+
- create-cluster-eks
281490
type: process
282491
desc: "StackSet e2e tests"
283492
target: stups-test
284493
process: microservice_standard_test
285494
config:
286495
apply_manifests:
287-
env: *apply_env
496+
env: *apply_env_eks
288497
end2end_tests:
289498
metadata:
290499
name: e2e
@@ -310,20 +519,20 @@ pipeline:
310519
cpu: 2
311520
memory: 1Gi
312521

313-
- id: decommission-cluster
522+
- id: decommission-cluster-eks
314523
when:
315524
event: pull_request
316525
depends_on:
317-
- e2e-tests
318-
- stackset-e2e-tests
319-
- e2e-load-test-result
526+
- e2e-tests-eks
527+
- stackset-e2e-tests-eks
528+
- e2e-load-test-result-eks
320529
type: process
321530
desc: "Decommission cluster used for Kubernetes e2e tests"
322531
target: stups-test
323532
process: microservice_standard_test
324533
config:
325534
apply_manifests:
326-
env: *apply_env
535+
env: *apply_env_eks
327536
end2end_tests:
328537
metadata:
329538
name: e2e

test/e2e/apply/config.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ metadata:
88
data:
99
HOSTED_ZONE: "teapot-e2e.zalan.do"
1010
REGION: "eu-central-1"
11+
CLUSTER_PROVIDER: "{{{CLUSTER_PROVIDER}}}"
12+
E2E_SKIP_CLUSTER_UPDATE: "{{{E2E_SKIP_CLUSTER_UPDATE}}}"

test/e2e/authorization.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ func getUnprivilegedClient(cluster *types.Cluster, awsAccountID string) (*kubern
813813

814814
// getPostgresAdministratorClient returns a client with the `zalando:postgres-admin` group.
815815
func getPostgresAdministratorClient(cluster *types.Cluster, awsAccountID string) (*kubernetes.Clientset, error) {
816-
return newClientWithRole(cluster, fmt.Sprintf("arn:aws:iam::%s:role/%s-e2e-eks-iam-test-postgres-administrator-role", awsAccountID, aws.ToString(cluster.Name)))
816+
return newClientWithRole(cluster, fmt.Sprintf("arn:aws:iam::%s:role/%s-e2e-eks-iam-test-postgres-admin-role", awsAccountID, aws.ToString(cluster.Name)))
817817
}
818818

819819
// newClientWithRole returns a new Kubernetes client with the specified IAM role and its associated AccessEntries.

0 commit comments

Comments
 (0)