Skip to content

Commit 64e269f

Browse files
authored
feat: AWS CCM for Kubernetes v1.29 (#564)
**What problem does this PR solve?**: Adds AWS CCM support for Kubernetes v1.29. While testing I also found an upstream change kubernetes/kubernetes#121028 and to fix that added `hostNetwork: true` to the CCM pods. Upstream CAPA templates and the Nutanix CCM already use `hostNetwork: true`, so it made sense to go with that approach here too. **Which issue(s) this PR fixes**: Fixes # **How Has This Been Tested?**: <!-- Please describe the tests that you ran to verify your changes. Provide output from the tests and any manual steps needed to replicate the tests. --> Created an AWS v1.29.4 cluster with the following lookup envs: ``` AMI_LOOKUP_BASEOS=rocky-9.1 AMI_LOOKUP_FORMAT=konvoy-ami-{{.BaseOS}}-release-?{{.K8sVersion}}-* AMI_LOOKUP_ORG=999867407951 ``` **Special notes for your reviewer**: <!-- Use this to provide any additional information to the reviewers. This may include: - Best way to review the PR. - Where the author wants the most review attention on. - etc. -->
1 parent cbd401f commit 64e269f

File tree

8 files changed

+209
-1
lines changed

8 files changed

+209
-1
lines changed

charts/cluster-api-runtime-extensions-nutanix/templates/ccm/aws/manifests/aws-ccm-v1.27.1-configmap.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ data:
167167
cpu: 200m
168168
securityContext: {}
169169
dnsPolicy: Default
170+
hostNetwork: true
170171
nodeSelector:
171172
node-role.kubernetes.io/control-plane: ""
172173
priorityClassName: system-node-critical

charts/cluster-api-runtime-extensions-nutanix/templates/ccm/aws/manifests/aws-ccm-v1.28.1-configmap.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ data:
167167
cpu: 200m
168168
securityContext: {}
169169
dnsPolicy: Default
170+
hostNetwork: true
170171
nodeSelector:
171172
node-role.kubernetes.io/control-plane: ""
172173
priorityClassName: system-node-critical
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
# Copyright 2023 D2iQ, Inc. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
#=================================================================
5+
# DO NOT EDIT THIS FILE
6+
# IT HAS BEEN GENERATED BY /hack/addons/update-aws-ccm.sh
7+
#=================================================================
8+
apiVersion: v1
9+
data:
10+
aws-ccm-v1.29.2.yaml: |
11+
apiVersion: v1
12+
kind: ServiceAccount
13+
metadata:
14+
labels:
15+
helm.sh/chart: aws-cloud-controller-manager-0.0.8
16+
name: cloud-controller-manager
17+
namespace: kube-system
18+
---
19+
apiVersion: rbac.authorization.k8s.io/v1
20+
kind: ClusterRole
21+
metadata:
22+
labels:
23+
helm.sh/chart: aws-cloud-controller-manager-0.0.8
24+
name: system:cloud-controller-manager
25+
rules:
26+
- apiGroups:
27+
- ""
28+
resources:
29+
- events
30+
verbs:
31+
- create
32+
- patch
33+
- update
34+
- apiGroups:
35+
- ""
36+
resources:
37+
- nodes
38+
verbs:
39+
- '*'
40+
- apiGroups:
41+
- ""
42+
resources:
43+
- nodes/status
44+
verbs:
45+
- patch
46+
- apiGroups:
47+
- ""
48+
resources:
49+
- services
50+
verbs:
51+
- list
52+
- patch
53+
- update
54+
- watch
55+
- apiGroups:
56+
- ""
57+
resources:
58+
- services/status
59+
verbs:
60+
- list
61+
- patch
62+
- update
63+
- watch
64+
- apiGroups:
65+
- ""
66+
resources:
67+
- serviceaccounts
68+
verbs:
69+
- create
70+
- apiGroups:
71+
- ""
72+
resources:
73+
- persistentvolumes
74+
verbs:
75+
- get
76+
- list
77+
- update
78+
- watch
79+
- apiGroups:
80+
- ""
81+
resources:
82+
- endpoints
83+
verbs:
84+
- create
85+
- get
86+
- list
87+
- watch
88+
- update
89+
- apiGroups:
90+
- coordination.k8s.io
91+
resources:
92+
- leases
93+
verbs:
94+
- create
95+
- get
96+
- list
97+
- watch
98+
- update
99+
- apiGroups:
100+
- ""
101+
resources:
102+
- serviceaccounts/token
103+
verbs:
104+
- create
105+
---
106+
apiVersion: rbac.authorization.k8s.io/v1
107+
kind: RoleBinding
108+
metadata:
109+
labels:
110+
helm.sh/chart: aws-cloud-controller-manager-0.0.8
111+
name: cloud-controller-manager:apiserver-authentication-reader
112+
namespace: kube-system
113+
roleRef:
114+
apiGroup: rbac.authorization.k8s.io
115+
kind: Role
116+
name: extension-apiserver-authentication-reader
117+
subjects:
118+
- apiGroup: ""
119+
kind: ServiceAccount
120+
name: cloud-controller-manager
121+
namespace: kube-system
122+
---
123+
apiVersion: rbac.authorization.k8s.io/v1
124+
kind: ClusterRoleBinding
125+
metadata:
126+
labels:
127+
helm.sh/chart: aws-cloud-controller-manager-0.0.8
128+
name: system:cloud-controller-manager
129+
roleRef:
130+
apiGroup: rbac.authorization.k8s.io
131+
kind: ClusterRole
132+
name: system:cloud-controller-manager
133+
subjects:
134+
- apiGroup: ""
135+
kind: ServiceAccount
136+
name: cloud-controller-manager
137+
namespace: kube-system
138+
---
139+
apiVersion: apps/v1
140+
kind: DaemonSet
141+
metadata:
142+
labels:
143+
helm.sh/chart: aws-cloud-controller-manager-0.0.8
144+
k8s-app: aws-cloud-controller-manager
145+
name: aws-cloud-controller-manager
146+
namespace: kube-system
147+
spec:
148+
selector:
149+
matchLabels:
150+
k8s-app: aws-cloud-controller-manager
151+
template:
152+
metadata:
153+
labels:
154+
k8s-app: aws-cloud-controller-manager
155+
name: aws-cloud-controller-manager
156+
spec:
157+
containers:
158+
- args:
159+
- --v=2
160+
- --cloud-provider=aws
161+
- --configure-cloud-routes=false
162+
env: []
163+
image: registry.k8s.io/provider-aws/cloud-controller-manager:v1.29.2
164+
name: aws-cloud-controller-manager
165+
resources:
166+
requests:
167+
cpu: 200m
168+
securityContext: {}
169+
dnsPolicy: Default
170+
hostNetwork: true
171+
nodeSelector:
172+
node-role.kubernetes.io/control-plane: ""
173+
priorityClassName: system-node-critical
174+
securityContext: {}
175+
serviceAccountName: cloud-controller-manager
176+
tolerations:
177+
- effect: NoSchedule
178+
key: node.cloudprovider.kubernetes.io/uninitialized
179+
value: "true"
180+
- effect: NoSchedule
181+
key: node-role.kubernetes.io/master
182+
- effect: NoSchedule
183+
key: node-role.kubernetes.io/control-plane
184+
updateStrategy:
185+
type: RollingUpdate
186+
kind: ConfigMap
187+
metadata:
188+
creationTimestamp: null
189+
name: aws-ccm-v1.29.2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright 2024 D2iQ, Inc. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
---
5+
# Starting in Kubernetes v1.29 the Kubelet no longer adds temporary addresses to the Node.
6+
# See https://github.com/kubernetes/kubernetes/pull/121028
7+
# This causes a deadlock with the AWS CCM and some CNI providers including Calico.
8+
# The Calico Pods won't start until some addresses are assigned,
9+
# but the AWS CCM that adds the addresses can't start until the Calico Pods are running.
10+
# Using hostNetworking allows the AWS CCM to start before the Calico Pods.
11+
# The upstream CAPA templates are also already using hostNetworking for the CCM Pods.
12+
hostNetworking: true

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

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ helmCharts:
1212
repo: https://kubernetes.github.io/cloud-provider-aws
1313
releaseName: aws-cloud-controller-manager
1414
version: ${AWS_CCM_CHART_VERSION}
15+
valuesFile: helm-values.yaml
1516
includeCRDs: true
1617
skipTests: true
1718

hack/addons/update-aws-ccm.sh

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ trap_add "rm -rf ${ASSETS_DIR}" EXIT
2424

2525
readonly KUSTOMIZE_BASE_DIR="${SCRIPT_DIR}/kustomize/aws-ccm/"
2626
envsubst -no-unset <"${KUSTOMIZE_BASE_DIR}/kustomization.yaml.tmpl" >"${ASSETS_DIR}/kustomization.yaml"
27+
cp "${KUSTOMIZE_BASE_DIR}"/*.yaml "${ASSETS_DIR}"
2728

2829
readonly FILE_NAME="aws-ccm-${AWS_CCM_VERSION}.yaml"
2930
kustomize build --enable-helm "${ASSETS_DIR}" >"${ASSETS_DIR}/${FILE_NAME}"

make/addons.mk

+3-1
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ export AWS_CCM_VERSION_127 := v1.27.1
1414
export AWS_CCM_CHART_VERSION_127 := 0.0.8
1515
export AWS_CCM_VERSION_128 := v1.28.1
1616
export AWS_CCM_CHART_VERSION_128 := 0.0.8
17+
export AWS_CCM_VERSION_129 := v1.29.2
18+
export AWS_CCM_CHART_VERSION_129 := 0.0.8
1719

1820
export NUTANIX_CCM_CHART_VERSION := 0.3.3
1921

2022
export KUBE_VIP_VERSION := v0.8.0
2123

2224
.PHONY: addons.sync
23-
addons.sync: $(addprefix update-addon.,calico cilium nfd cluster-autoscaler aws-ebs-csi aws-ccm.127 aws-ccm.128 kube-vip)
25+
addons.sync: $(addprefix update-addon.,calico cilium nfd cluster-autoscaler aws-ebs-csi aws-ccm.127 aws-ccm.128 aws-ccm.129 kube-vip)
2426

2527
.PHONY: update-addon.calico
2628
update-addon.calico: ; $(info $(M) updating calico manifests)

pkg/handlers/generic/lifecycle/ccm/aws/handler.go

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ func (a *AWSCCMConfig) AddFlags(prefix string, flags *pflag.FlagSet) {
3434
map[string]string{
3535
"1.27": "aws-ccm-v1.27.1",
3636
"1.28": "aws-ccm-v1.28.1",
37+
"1.29": "aws-ccm-v1.29.2",
3738
},
3839
"map of provider cluster implementation type to default installation ConfigMap name",
3940
)

0 commit comments

Comments
 (0)