Skip to content

Commit 2853e09

Browse files
authored
Merge pull request #1811 from ConnorJC3/123a1
[cherry-pick release-1.23] Add compatibility workaround for A1 instance family
2 parents 59c983b + 3726210 commit 2853e09

File tree

9 files changed

+64
-8
lines changed

9 files changed

+64
-8
lines changed

Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ ARG TARGETARCH
2626
ARG VERSION
2727
RUN OS=$TARGETOS ARCH=$TARGETARCH make $TARGETOS/$TARGETARCH
2828

29-
FROM public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-csi-ebs:latest-al23 AS linux-amazon
29+
FROM public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-csi-ebs:latest-al23 AS linux-al2023
30+
COPY --from=builder /go/src/github.com/kubernetes-sigs/aws-ebs-csi-driver/bin/aws-ebs-csi-driver /bin/aws-ebs-csi-driver
31+
ENTRYPOINT ["/bin/aws-ebs-csi-driver"]
32+
33+
FROM public.ecr.aws/eks-distro-build-tooling/eks-distro-minimal-base-csi-ebs:latest-al2 AS linux-al2
3034
COPY --from=builder /go/src/github.com/kubernetes-sigs/aws-ebs-csi-driver/bin/aws-ebs-csi-driver /bin/aws-ebs-csi-driver
3135
ENTRYPOINT ["/bin/aws-ebs-csi-driver"]
3236

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ OUTPUT_TYPE?=docker
3333

3434
OS?=linux
3535
ARCH?=amd64
36-
OSVERSION?=amazon
36+
OSVERSION?=al2023
3737

3838
ALL_OS?=linux windows
3939
ALL_ARCH_linux?=amd64 arm64
40-
ALL_OSVERSION_linux?=amazon
40+
ALL_OSVERSION_linux?=al2023
4141
ALL_OS_ARCH_OSVERSION_linux=$(foreach arch, $(ALL_ARCH_linux), $(foreach osversion, ${ALL_OSVERSION_linux}, linux-$(arch)-${osversion}))
4242

4343
ALL_ARCH_windows?=amd64
@@ -86,7 +86,7 @@ create-manifest: all-image-registry
8686
.PHONY: all-image-docker
8787
all-image-docker: $(addprefix sub-image-docker-,$(ALL_OS_ARCH_OSVERSION_linux))
8888
.PHONY: all-image-registry
89-
all-image-registry: $(addprefix sub-image-registry-,$(ALL_OS_ARCH_OSVERSION))
89+
all-image-registry: sub-image-registry-linux-arm64-al2 $(addprefix sub-image-registry-,$(ALL_OS_ARCH_OSVERSION))
9090

9191
sub-image-%:
9292
$(MAKE) OUTPUT_TYPE=$(call word-hyphen,$*,1) OS=$(call word-hyphen,$*,2) ARCH=$(call word-hyphen,$*,3) OSVERSION=$(call word-hyphen,$*,4) image

charts/aws-ebs-csi-driver/templates/_node-windows.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{{- define "node-windows" }}
22
{{- if .Values.node.enableWindows }}
3+
---
34
kind: DaemonSet
45
apiVersion: apps/v1
56
metadata:

charts/aws-ebs-csi-driver/templates/_node.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{{- define "node" }}
22
{{- if or (eq (default true .Values.node.enableLinux) true) }}
3+
---
34
kind: DaemonSet
45
apiVersion: apps/v1
56
metadata:

charts/aws-ebs-csi-driver/templates/node-windows.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@
99
"node" (deepCopy $.Values.node | mustMerge $values)
1010
)
1111
}}
12-
---
1312
{{- include "node-windows" (deepCopy $ | mustMerge $args) -}}
1413
{{- end }}

charts/aws-ebs-csi-driver/templates/node.yaml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,38 @@
99
"node" (deepCopy $.Values.node | mustMerge $values)
1010
)
1111
}}
12-
---
12+
{{- include "node" (deepCopy $ | mustMerge $args) -}}
13+
{{- end }}
14+
{{- if .Values.a1CompatibilityDaemonSet }}
15+
{{$args := dict
16+
"NodeName" "ebs-csi-node-a1compat"
17+
"Values" (dict
18+
"image" (dict
19+
"tag" (printf "%s-a1compat" (default (printf "v%s" .Chart.AppVersion) (.Values.image.tag | toString)))
20+
)
21+
"node" (dict
22+
"affinity" (dict
23+
"nodeAffinity" (dict
24+
"requiredDuringSchedulingIgnoredDuringExecution" (dict
25+
"nodeSelectorTerms" (list
26+
(dict "matchExpressions" (list
27+
(dict
28+
"key" "eks.amazonaws.com/compute-type"
29+
"operator" "NotIn"
30+
"values" (list "fargate")
31+
)
32+
(dict
33+
"key" "node.kubernetes.io/instance-type"
34+
"operator" "In"
35+
"values" (list "a1.medium" "a1.large" "a1.xlarge" "a1.2xlarge" "a1.4xlarge")
36+
)
37+
))
38+
)
39+
)
40+
)
41+
)
42+
)
43+
)
44+
}}
1345
{{- include "node" (deepCopy $ | mustMerge $args) -}}
1446
{{- end }}

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,14 @@ node:
317317
operator: NotIn
318318
values:
319319
- fargate
320+
- key: node.kubernetes.io/instance-type
321+
operator: NotIn
322+
values:
323+
- a1.medium
324+
- a1.large
325+
- a1.xlarge
326+
- a1.2xlarge
327+
- a1.4xlarge
320328
nodeSelector: {}
321329
podAnnotations: {}
322330
podLabels: {}
@@ -382,6 +390,9 @@ additionalDaemonSets:
382390
# node.kubernetes.io/instance-type: c5.large
383391
# volumeAttachLimit: 15
384392

393+
# Enable compatibility for the A1 instance family via use of an AL2-based image in a separate DaemonSet
394+
# a1CompatibilityDaemonSet: true
395+
385396
storageClasses: []
386397
# Add StorageClass resources like:
387398
# - name: ebs-sc

deploy/kubernetes/base/node.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@ spec:
3030
operator: NotIn
3131
values:
3232
- fargate
33+
- key: node.kubernetes.io/instance-type
34+
operator: NotIn
35+
values:
36+
- a1.medium
37+
- a1.large
38+
- a1.xlarge
39+
- a1.2xlarge
40+
- a1.4xlarge
3341
nodeSelector:
3442
kubernetes.io/os: linux
3543
serviceAccountName: ebs-csi-node-sa

hack/e2e/ecr.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ function ecr_build_and_push() {
2727
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
2828
make all-push
2929
else
30-
IMAGE=${IMAGE_NAME} TAG=${IMAGE_TAG} OS=linux ARCH=amd64 OSVERSION=amazon make image
31-
docker tag "${IMAGE_NAME}":"${IMAGE_TAG}"-linux-amd64-amazon "${IMAGE_NAME}":"${IMAGE_TAG}"
30+
IMAGE=${IMAGE_NAME} TAG=${IMAGE_TAG} OS=linux ARCH=amd64 OSVERSION=al2023 make image
31+
docker tag "${IMAGE_NAME}":"${IMAGE_TAG}"-linux-amd64-al2023 "${IMAGE_NAME}":"${IMAGE_TAG}"
3232
docker push "${IMAGE_NAME}":"${IMAGE_TAG}"
3333
fi
3434
fi

0 commit comments

Comments
 (0)