Skip to content

Commit 04dce16

Browse files
authored
feat: Update AWS CCM versions (#748)
While I was thinking how to list all images we require for CAREN, I noticed that we can use helm values to do the necessary overrides for AWS CCM image and container args. At the same time, I updated to the latest versions available and added k8s v1.30 support to the handler.
1 parent e56427e commit 04dce16

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+835
-183
lines changed

api/v1alpha1/addon_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,11 @@ type CCM struct {
238238
// A reference to the Secret for credential information for the target Prism Central instance
239239
// +kubebuilder:validation:Optional
240240
Credentials *CCMCredentials `json:"credentials,omitempty"`
241+
242+
// Addon strategy used to deploy the CCM to the workload cluster.
243+
// +kubebuilder:validation:Required
244+
// +kubebuilder:validation:Enum=ClusterResourceSet;HelmAddon
245+
Strategy AddonStrategy `json:"strategy"`
241246
}
242247

243248
type CCMCredentials struct {
@@ -250,5 +255,6 @@ type ServiceLoadBalancer struct {
250255
// The LoadBalancer-type Service provider to deploy. Not required in infrastructures where
251256
// the CCM acts as the provider.
252257
// +kubebuilder:validation:Enum=MetalLB
258+
// +kubebuilder:validation:Required
253259
Provider string `json:"provider"`
254260
}

api/v1alpha1/crds/caren.nutanix.com_awsclusterconfigs.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ spec:
6464
required:
6565
- secretRef
6666
type: object
67+
strategy:
68+
description: Addon strategy used to deploy the CCM to the workload cluster.
69+
enum:
70+
- ClusterResourceSet
71+
- HelmAddon
72+
type: string
73+
required:
74+
- strategy
6775
type: object
6876
clusterAutoscaler:
6977
description: ClusterAutoscaler tells us to enable or disable the cluster-autoscaler addon.

api/v1alpha1/crds/caren.nutanix.com_dockerclusterconfigs.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ spec:
6464
required:
6565
- secretRef
6666
type: object
67+
strategy:
68+
description: Addon strategy used to deploy the CCM to the workload cluster.
69+
enum:
70+
- ClusterResourceSet
71+
- HelmAddon
72+
type: string
73+
required:
74+
- strategy
6775
type: object
6876
clusterAutoscaler:
6977
description: ClusterAutoscaler tells us to enable or disable the cluster-autoscaler addon.

api/v1alpha1/crds/caren.nutanix.com_nutanixclusterconfigs.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ spec:
6464
required:
6565
- secretRef
6666
type: object
67+
strategy:
68+
description: Addon strategy used to deploy the CCM to the workload cluster.
69+
enum:
70+
- ClusterResourceSet
71+
- HelmAddon
72+
type: string
73+
required:
74+
- strategy
6775
type: object
6876
clusterAutoscaler:
6977
description: ClusterAutoscaler tells us to enable or disable the cluster-autoscaler addon.

charts/cluster-api-runtime-extensions-nutanix/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ A Helm chart for cluster-api-runtime-extensions-nutanix
3535
| helmRepositoryImage.pullPolicy | string | `"IfNotPresent"` | |
3636
| helmRepositoryImage.repository | string | `"ghcr.io/nutanix-cloud-native/caren-helm-reg"` | |
3737
| helmRepositoryImage.tag | string | `""` | |
38+
| hooks.ccm.aws.helmAddonStrategy.defaultValueTemplateConfigMap.create | bool | `true` | |
39+
| hooks.ccm.aws.helmAddonStrategy.defaultValueTemplateConfigMap.name | string | `"default-aws-ccm-helm-values-template"` | |
40+
| hooks.ccm.aws.k8sMinorVersionToCCMVersion."1.27" | string | `"v1.27.7"` | |
41+
| hooks.ccm.aws.k8sMinorVersionToCCMVersion."1.28" | string | `"v1.28.6"` | |
42+
| hooks.ccm.aws.k8sMinorVersionToCCMVersion."1.29" | string | `"v1.29.3"` | |
43+
| hooks.ccm.aws.k8sMinorVersionToCCMVersion."1.30" | string | `"v1.30.1"` | |
3844
| hooks.ccm.nutanix.helmAddonStrategy.defaultValueTemplateConfigMap.create | bool | `true` | |
3945
| hooks.ccm.nutanix.helmAddonStrategy.defaultValueTemplateConfigMap.name | string | `"default-nutanix-ccm-helm-values-template"` | |
4046
| hooks.clusterAutoscaler.crsStrategy.defaultInstallationConfigMap.name | string | `"cluster-autoscaler"` | |
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#=================================================================
88
apiVersion: v1
99
data:
10-
aws-ccm-v1.27.1.yaml: |
10+
aws-ccm-v1.27.7.yaml: |
1111
apiVersion: v1
1212
kind: ServiceAccount
1313
metadata:
@@ -160,7 +160,7 @@ data:
160160
- --cloud-provider=aws
161161
- --configure-cloud-routes=false
162162
env: []
163-
image: registry.k8s.io/provider-aws/cloud-controller-manager:v1.27.1
163+
image: registry.k8s.io/provider-aws/cloud-controller-manager:v1.27.7
164164
name: aws-cloud-controller-manager
165165
resources:
166166
requests:
@@ -186,4 +186,4 @@ data:
186186
kind: ConfigMap
187187
metadata:
188188
creationTimestamp: null
189-
name: aws-ccm-v1.27.1
189+
name: aws-ccm-v1.27.7
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#=================================================================
88
apiVersion: v1
99
data:
10-
aws-ccm-v1.28.1.yaml: |
10+
aws-ccm-v1.28.6.yaml: |
1111
apiVersion: v1
1212
kind: ServiceAccount
1313
metadata:
@@ -160,7 +160,7 @@ data:
160160
- --cloud-provider=aws
161161
- --configure-cloud-routes=false
162162
env: []
163-
image: registry.k8s.io/provider-aws/cloud-controller-manager:v1.28.1
163+
image: registry.k8s.io/provider-aws/cloud-controller-manager:v1.28.6
164164
name: aws-cloud-controller-manager
165165
resources:
166166
requests:
@@ -186,4 +186,4 @@ data:
186186
kind: ConfigMap
187187
metadata:
188188
creationTimestamp: null
189-
name: aws-ccm-v1.28.1
189+
name: aws-ccm-v1.28.6
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#=================================================================
88
apiVersion: v1
99
data:
10-
aws-ccm-v1.29.2.yaml: |
10+
aws-ccm-v1.29.3.yaml: |
1111
apiVersion: v1
1212
kind: ServiceAccount
1313
metadata:
@@ -160,7 +160,7 @@ data:
160160
- --cloud-provider=aws
161161
- --configure-cloud-routes=false
162162
env: []
163-
image: registry.k8s.io/provider-aws/cloud-controller-manager:v1.29.2
163+
image: registry.k8s.io/provider-aws/cloud-controller-manager:v1.29.3
164164
name: aws-cloud-controller-manager
165165
resources:
166166
requests:
@@ -186,4 +186,4 @@ data:
186186
kind: ConfigMap
187187
metadata:
188188
creationTimestamp: null
189-
name: aws-ccm-v1.29.2
189+
name: aws-ccm-v1.29.3
Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
# Copyright 2024 Nutanix. 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.30.1.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.30.1
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.30.1
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright 2024 Nutanix. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
{{- if .Values.hooks.ccm.aws.helmAddonStrategy.defaultValueTemplateConfigMap.create }}
5+
apiVersion: v1
6+
kind: ConfigMap
7+
metadata:
8+
name: '{{ .Values.hooks.ccm.aws.helmAddonStrategy.defaultValueTemplateConfigMap.name }}'
9+
data:
10+
values.yaml: |-
11+
# Starting in Kubernetes v1.29 the Kubelet no longer adds temporary addresses to the Node.
12+
# See https://github.com/kubernetes/kubernetes/pull/121028
13+
# This causes a deadlock with the AWS CCM and some CNI providers including Calico.
14+
# The Calico Pods won't start until some addresses are assigned,
15+
# but the AWS CCM that adds the addresses can't start until the Calico Pods are running.
16+
# Using hostNetworking allows the AWS CCM to start before the Calico Pods.
17+
# The upstream CAPA templates are also already using hostNetworking for the CCM Pods.
18+
hostNetworking: true
19+
20+
args:
21+
- --v=2
22+
- --cloud-provider=aws
23+
- --configure-cloud-routes=false
24+
25+
{{ "{{" }} $k8sMinorVersionToCCMVersion := dict
26+
{{ range $k8sVersion, $ccmVersion := .Values.hooks.ccm.aws.k8sMinorVersionToCCMVersion -}}
27+
"{{ $k8sVersion }}" "{{ $ccmVersion }}"
28+
{{ end -}}
29+
{{ "}}" }}
30+
{{ "{{" }}$clusterSemver := semver .Cluster.spec.topology.version {{ "}}" }}
31+
{{ "{{" }}$ccmVersion := get $k8sMinorVersionToCCMVersion ( print $clusterSemver.Major "." $clusterSemver.Minor ) {{ "}}" }}
32+
image:
33+
tag: {{ "{{ " }} $ccmVersion {{ "}}" }}
34+
{{- end -}}

charts/cluster-api-runtime-extensions-nutanix/templates/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ spec:
4040
- --csi.nutanix.helm-addon.default-values-template-configmap-name={{ (index .Values.hooks.csi "nutanix").helmAddonStrategy.defaultValueTemplateConfigMap.name }}
4141
- --csi.local-path.helm-addon.default-values-template-configmap-name={{ (index .Values.hooks.csi "local-path").helmAddonStrategy.defaultValueTemplateConfigMap.name }}
4242
- --csi.snapshot-controller.helm-addon.default-values-template-configmap-name={{ (index .Values.hooks.csi "snapshot-controller").helmAddonStrategy.defaultValueTemplateConfigMap.name }}
43+
- --ccm.aws.helm-addon.default-values-template-configmap-name={{ .Values.hooks.ccm.aws.helmAddonStrategy.defaultValueTemplateConfigMap.name }}
44+
{{- range $k, $v := .Values.hooks.ccm.aws.k8sMinorVersionToCCMVersion }}
45+
- --ccm.aws.aws-ccm-versions={{ $k }}={{ $v }}
46+
{{- end }}
4347
{{- range $key, $value := .Values.extraArgs }}
4448
- --{{ $key }}={{ $value }}
4549
{{- end }}

charts/cluster-api-runtime-extensions-nutanix/templates/helm-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
#=================================================================
88
apiVersion: v1
99
data:
10+
aws-ccm: |
11+
ChartName: aws-cloud-controller-manager
12+
ChartVersion: 0.0.8
13+
RepositoryURL: {{ if .Values.selfHostedRegistry }}oci://helm-repository.{{ .Release.Namespace }}.svc/charts{{ else }}https://kubernetes.github.io/cloud-provider-aws{{ end }}
1014
aws-ebs-csi: |
1115
ChartName: aws-ebs-csi-driver
1216
ChartVersion: 2.28.1

0 commit comments

Comments
 (0)