Skip to content
This repository was archived by the owner on Apr 11, 2024. It is now read-only.

Commit 71d3968

Browse files
authored
feat: Upgrade AWS ESB CSI and switch to using Helm chart (nutanix-cloud-native#393)
This will make it easier to adopt the HelmAddon strategy for deploying the AWS ESB CSI addon. Depends on nutanix-cloud-native#392
1 parent 34ab8ec commit 71d3968

15 files changed

+236
-113
lines changed

charts/capi-runtime-extensions/templates/csi/aws-ebs/manifests/aws-ebs-csi-configmap.yaml

Lines changed: 123 additions & 18 deletions
Large diffs are not rendered by default.

hack/addons/kustomize/aws-cpi/kustomization.yaml.tmpl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ metadata:
99

1010
helmCharts:
1111
- name: aws-cloud-controller-manager
12-
includeCRDs: true
12+
repo: https://kubernetes.github.io/cloud-provider-aws
1313
releaseName: aws-cloud-controller-manager
1414
version: ${AWS_CPI_CHART_VERSION}
15-
repo: https://kubernetes.github.io/cloud-provider-aws
15+
includeCRDs: true
16+
skipTests: true
1617

1718
patches:
1819
- patch: |-
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright 2024 D2iQ, Inc. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
---
5+
controller:
6+
affinity:
7+
nodeAffinity:
8+
requiredDuringSchedulingIgnoredDuringExecution:
9+
nodeSelectorTerms:
10+
- matchExpressions:
11+
- key: node-role.kubernetes.io/control-plane
12+
operator: Exists
13+
tolerations:
14+
- key: CriticalAddonsOnly
15+
operator: Exists
16+
- effect: NoExecute
17+
operator: Exists
18+
tolerationSeconds: 300
19+
- effect: NoSchedule
20+
key: node-role.kubernetes.io/master
21+
operator: Exists
22+
- effect: NoSchedule
23+
key: node-role.kubernetes.io/control-plane
24+
operator: Exists
25+
node:
26+
priorityClassName: system-node-critical
27+
sidecars:
28+
snapshotter:
29+
forceEnable: true
30+
storageClasses:
31+
- metadata:
32+
name: ebs-sc
33+
volumeBindingMode: WaitForFirstConsumer
34+
parameters:
35+
csi.storage.k8s.io/fstype: ext4
36+
type: gp3

hack/addons/kustomize/aws-ebs-csi/kustomization.yaml.tmpl

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,16 @@ kind: Kustomization
77
metadata:
88
name: aws-ebs-csi-kustomize
99

10-
resources:
11-
- github.com/kubernetes-sigs/aws-ebs-csi-driver/deploy/kubernetes/overlays/stable/?ref=${AWS_EBS_CSI_VERSION}
12-
- storage-class.yaml
13-
- github.com/kubernetes-csi/external-snapshotter/client/config/crd/?ref=${AWS_CSI_SNAPSHOT_CONTROLLER_VERSION}
14-
- github.com/kubernetes-csi/external-snapshotter/deploy/kubernetes/snapshot-controller/?ref=${AWS_CSI_SNAPSHOT_CONTROLLER_VERSION}
10+
namespace: kube-system
1511

16-
patches:
17-
- path: ./overlays/controller-nodeAffinity.yaml
18-
target:
19-
kind: Deployment
20-
name: ebs-csi-controller
21-
namespace: kube-system
22-
- path: ./overlays/controller-nodeAffinity.yaml
23-
target:
24-
kind: Deployment
25-
name: snapshot-controller
26-
namespace: kube-system
27-
- path: ./overlays/deployment-priorityClassName.yaml
28-
target:
29-
kind: Deployment
30-
name: snapshot-controller
31-
namespace: kube-system
32-
- path: ./overlays/ds-tolerations.yaml
33-
target:
34-
kind: DaemonSet
35-
name: ebs-csi-node
36-
namespace: kube-system
12+
helmCharts:
13+
- name: aws-ebs-csi-driver
14+
repo: https://kubernetes-sigs.github.io/aws-ebs-csi-driver
15+
releaseName: aws-ebs-csi-driver
16+
version: ${AWS_EBS_CSI_CHART_VERSION}
17+
valuesFile: helm-values.yaml
18+
includeCRDs: true
19+
skipTests: true
3720

38-
# always override the images to match the version from the set envs
39-
images:
40-
- name: public.ecr.aws/ebs-csi-driver/aws-ebs-csi-driver
41-
newTag: ${AWS_EBS_CSI_VERSION}
42-
- name: registry.k8s.io/sig-storage/snapshot-controller
43-
newTag: ${AWS_CSI_SNAPSHOT_CONTROLLER_VERSION}
21+
resources:
22+
- ../external-snapshotter

hack/addons/kustomize/aws-ebs-csi/overlays/controller-priorityClassName.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

hack/addons/kustomize/aws-ebs-csi/overlays/ds-priorityClassName.yaml

Lines changed: 0 additions & 11 deletions
This file was deleted.

hack/addons/kustomize/aws-ebs-csi/overlays/ds-tolerations.yaml

Lines changed: 0 additions & 17 deletions
This file was deleted.

hack/addons/kustomize/cilium/kustomization.yaml.tmpl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ sortOptions:
1212

1313
helmCharts:
1414
- name: cilium
15-
includeCRDs: true
16-
valuesFile: helm-values.yaml
15+
repo: https://helm.cilium.io/
1716
releaseName: cilium
1817
version: ${CILIUM_VERSION}
19-
repo: https://helm.cilium.io/
18+
valuesFile: helm-values.yaml
19+
includeCRDs: true
20+
skipTests: true
2021

2122
namespace: kube-system
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Copyright 2023 D2iQ, Inc. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
apiVersion: kustomize.config.k8s.io/v1beta1
5+
kind: Kustomization
6+
7+
metadata:
8+
name: external-snapshotter-kustomize
9+
10+
namespace: kube-system
11+
12+
resources:
13+
- github.com/kubernetes-csi/external-snapshotter/client/config/crd/?ref=${AWS_CSI_SNAPSHOT_CONTROLLER_VERSION}
14+
- github.com/kubernetes-csi/external-snapshotter/deploy/kubernetes/snapshot-controller/?ref=${AWS_CSI_SNAPSHOT_CONTROLLER_VERSION}
15+
16+
patches:
17+
- path: ./overlays/deployment-nodeAffinity.yaml
18+
target:
19+
kind: Deployment
20+
name: snapshot-controller
21+
namespace: kube-system
22+
- path: ./overlays/deployment-priorityClassName.yaml
23+
target:
24+
kind: Deployment
25+
name: snapshot-controller
26+
namespace: kube-system
27+
28+
# always override the images to match the version from the set envs
29+
images:
30+
- name: registry.k8s.io/sig-storage/snapshot-controller
31+
newTag: ${AWS_CSI_SNAPSHOT_CONTROLLER_VERSION}

hack/addons/kustomize/aws-ebs-csi/overlays/controller-nodeAffinity.yaml renamed to hack/addons/kustomize/external-snapshotter/overlays/deployment-nodeAffinity.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ spec:
1515
- matchExpressions:
1616
- key: node-role.kubernetes.io/control-plane
1717
operator: Exists
18-
nodeSelector:
19-
node-role.kubernetes.io/control-plane: null
20-
node-role.kubernetes.io/master: null
2118
tolerations:
2219
- key: CriticalAddonsOnly
2320
operator: Exists

hack/addons/kustomize/nfd/kustomization.yaml.tmpl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ resources:
1212

1313
helmCharts:
1414
- name: node-feature-discovery
15-
includeCRDs: true
15+
repo: https://kubernetes-sigs.github.io/node-feature-discovery/charts
16+
releaseName: node-feature-discovery
17+
version: ${NODE_FEATURE_DISCOVERY_VERSION}
1618
valuesFile: helm-values.yaml
1719
valuesInline:
1820
image:
1921
tag: "v${NODE_FEATURE_DISCOVERY_VERSION}-minimal"
20-
releaseName: node-feature-discovery
21-
version: ${NODE_FEATURE_DISCOVERY_VERSION}
22-
repo: https://kubernetes-sigs.github.io/node-feature-discovery/charts
22+
includeCRDs: true
23+
skipTests: true
2324

2425
namespace: node-feature-discovery

hack/addons/kustomize/tigera-operator/kustomization.yaml.tmpl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ resources:
1515

1616
helmCharts:
1717
- name: tigera-operator
18-
includeCRDs: true
19-
valuesFile: helm-values.yaml
18+
repo: https://docs.tigera.io/calico/charts
2019
releaseName: tigera-operator
2120
version: ${CALICO_VERSION}
22-
repo: https://docs.tigera.io/calico/charts
21+
valuesFile: helm-values.yaml
22+
includeCRDs: true
23+
skipTests: true
2324

2425
namespace: tigera-operator

hack/addons/update-aws-ebs-csi.sh

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ readonly SCRIPT_DIR
88
# shellcheck source=hack/common.sh
99
source "${SCRIPT_DIR}/../common.sh"
1010

11-
if [ -z "${AWS_EBS_CSI_VERSION:-}" ]; then
12-
echo "Missing environment variable: AWS_EBS_CSI_VERSION"
11+
if [ -z "${AWS_EBS_CSI_CHART_VERSION:-}" ]; then
12+
echo "Missing environment variable: AWS_EBS_CSI_CHART_VERSION"
13+
exit 1
14+
fi
15+
if [ -z "${AWS_CSI_SNAPSHOT_CONTROLLER_VERSION:-}" ]; then
16+
echo "Missing environment variable: AWS_CSI_SNAPSHOT_CONTROLLER_VERSION"
1317
exit 1
1418
fi
1519

@@ -19,11 +23,17 @@ trap_add "rm -rf ${ASSETS_DIR}" EXIT
1923

2024
readonly FILE_NAME="aws-ebs-csi.yaml"
2125

22-
readonly KUSTOMIZE_BASE_DIR="${SCRIPT_DIR}/kustomize/aws-ebs-csi/"
23-
envsubst -no-unset <"${KUSTOMIZE_BASE_DIR}/kustomization.yaml.tmpl" >"${ASSETS_DIR}/kustomization.yaml"
24-
cp "${KUSTOMIZE_BASE_DIR}"/*.yaml "${ASSETS_DIR}"
25-
cp -r "${KUSTOMIZE_BASE_DIR}"/overlays "${ASSETS_DIR}"
26-
kustomize build --enable-helm "${ASSETS_DIR}" >"${ASSETS_DIR}/${FILE_NAME}"
26+
readonly KUSTOMIZE_BASE_DIR="${SCRIPT_DIR}/kustomize/aws-ebs-csi"
27+
mkdir -p "${ASSETS_DIR}/aws-ebs-csi"
28+
envsubst -no-unset <"${KUSTOMIZE_BASE_DIR}/kustomization.yaml.tmpl" >"${ASSETS_DIR}/aws-ebs-csi/kustomization.yaml"
29+
cp -r "${KUSTOMIZE_BASE_DIR}"/*.yaml "${ASSETS_DIR}/aws-ebs-csi/"
30+
31+
readonly EXTERNAL_SNAPSHOTTER_BASE_DIR="${SCRIPT_DIR}/kustomize/external-snapshotter"
32+
mkdir -p "${ASSETS_DIR}/external-snapshotter"
33+
envsubst -no-unset <"${EXTERNAL_SNAPSHOTTER_BASE_DIR}/kustomization.yaml.tmpl" >"${ASSETS_DIR}/external-snapshotter/kustomization.yaml"
34+
cp -r "${EXTERNAL_SNAPSHOTTER_BASE_DIR}/overlays" "${ASSETS_DIR}/external-snapshotter/"
35+
36+
kustomize build --enable-helm "${ASSETS_DIR}/aws-ebs-csi/" >"${ASSETS_DIR}/${FILE_NAME}"
2737

2838
kubectl create configmap aws-ebs-csi --dry-run=client --output yaml \
2939
--from-file "${ASSETS_DIR}/${FILE_NAME}" \

make/addons.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
export CALICO_VERSION := $(shell goprintconst -file pkg/handlers/generic/lifecycle/cni/calico/strategy_helmaddon.go -name defaultCalicoHelmChartVersion)
55
export CILIUM_VERSION := $(shell goprintconst -file pkg/handlers/generic/lifecycle/cni/cilium/strategy_helmaddon.go -name defaultCiliumHelmChartVersion)
66
export NODE_FEATURE_DISCOVERY_VERSION := $(shell goprintconst -file pkg/handlers/generic/lifecycle/nfd/strategy_helmaddon.go -name defaultHelmChartVersion)
7-
export AWS_CSI_SNAPSHOT_CONTROLLER_VERSION := v6.3.0
8-
export AWS_EBS_CSI_VERSION := v1.25.0
7+
export AWS_CSI_SNAPSHOT_CONTROLLER_VERSION := v6.3.3
8+
export AWS_EBS_CSI_CHART_VERSION := v2.28.1
99
# a map of AWS CPI versions
1010
export AWS_CPI_VERSION_127 := v1.27.1
1111
export AWS_CPI_CHART_VERSION_127 := 0.0.8

0 commit comments

Comments
 (0)