Skip to content

Commit 4eb115f

Browse files
committed
Improve eksctl config and migrate to pod identities
Signed-off-by: Connor Catlett <conncatl@amazon.com>
1 parent ef4b3ee commit 4eb115f

File tree

3 files changed

+19
-31
lines changed

3 files changed

+19
-31
lines changed

hack/e2e/config.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ IMAGE_ARCH=${IMAGE_ARCH:-amd64}
6767
DEPLOY_METHOD=${DEPLOY_METHOD:-"helm"}
6868
HELM_CT_TEST=${HELM_CT_TEST:-"false"}
6969
HELM_EXTRA_FLAGS=${HELM_EXTRA_FLAGS:-}
70+
# When using IRSA, eksctl creates the service account
71+
if [[ -n "${USE_IRSA:-}" ]]; then
72+
HELM_EXTRA_FLAGS="${HELM_EXTRA_FLAGS} --set controller.serviceAccount.create=false"
73+
fi
7074
COLLECT_METRICS=${COLLECT_METRICS:-"false"}
7175

7276
TEST_PATH=${TEST_PATH:-"./tests/e2e-kubernetes/..."}

hack/e2e/eksctl/cluster.yaml

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -19,44 +19,27 @@ metadata:
1919
region: {{ .Env.REGION }}
2020
version: "{{ .Env.K8S_VERSION }}"
2121
availabilityZones: [{{ .Env.ZONES }}]
22+
autoModeConfig:
23+
enabled: false
2224
iam:
2325
vpcResourceControllerPolicy: true
26+
{{- if env.Getenv "USE_IRSA" }}
2427
withOIDC: true
2528
serviceAccounts:
2629
- metadata:
2730
name: ebs-csi-controller-sa
2831
namespace: kube-system
2932
wellKnownPolicies:
3033
ebsCSIController: true
31-
attachPolicy:
32-
Version: '2012-10-17'
33-
Statement:
34-
- Effect: Allow
35-
Action:
36-
- ec2:CopyVolumes
37-
Resource: "arn:aws:ec2:*:*:volume/vol-*"
38-
- Effect: Allow
39-
Action:
40-
- ec2:CopyVolumes
41-
Resource: "arn:aws:ec2:*:*:volume/*"
42-
Condition:
43-
StringLike:
44-
"aws:RequestTag/ebs.csi.aws.com/cluster": "true"
45-
- Effect: Allow
46-
Action:
47-
- ec2:CopyVolumes
48-
Resource: "arn:aws:ec2:*:*:volume/*"
49-
Condition:
50-
StringLike:
51-
"aws:RequestTag/CSIVolumeName": "*"
52-
- Effect: Allow
53-
Action:
54-
- ec2:CreateTags
55-
Resource:
56-
- "arn:aws:ec2:*:*:volume/*"
57-
Condition:
58-
StringEquals:
59-
"ec2:CreateAction": "CopyVolumes"
34+
{{- else }}
35+
podIdentityAssociations:
36+
- namespace: kube-system
37+
serviceAccountName: ebs-csi-controller-sa
38+
wellKnownPolicies:
39+
ebsCSIController: true
40+
addons:
41+
- name: eks-pod-identity-agent
42+
{{- end }}
6043
managedNodeGroups:
6144
- name: ng-linux
6245
amiFamily: {{ .Env.AMI_FAMILY }}
@@ -78,6 +61,7 @@ managedNodeGroups:
7861
instanceTypes: [m5.2xlarge]
7962
ssh:
8063
allow: false
64+
enableSsm: true
8165
{{- end }}
8266
nodeGroups:
8367
{{- if env.Getenv "OUTPOST_ARN" }}
@@ -93,6 +77,7 @@ nodeGroups:
9377
instanceType: {{ .Env.OUTPOST_INSTANCE_TYPE }}
9478
ssh:
9579
allow: false
80+
enableSsm: true
9681
outpostARN: {{ .Env.OUTPOST_ARN }}
9782
{{- end }}
9883
{{- if and (eq .Env.WINDOWS "true") (env.Getenv "WINDOWS_AMI") }}
@@ -105,4 +90,5 @@ nodeGroups:
10590
instanceType: m5.2xlarge
10691
ssh:
10792
allow: false
93+
enableSsm: true
10894
{{- end }}

hack/e2e/eksctl/values.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,5 @@
1414

1515
controller:
1616
logLevel: 5
17-
serviceAccount:
18-
create: false # let eksctl create it
1917
node:
2018
logLevel: 5

0 commit comments

Comments
 (0)