Skip to content

Commit 376cfd4

Browse files
dkoshkinjimmidyson
andauthored
feat: EKS ClusterClass and example (#1296)
**What problem does this PR solve?**: Adding a ClusterClass and an example file for EKS clusters. Based on #1255, 1. with minor changes to fixup after more recent changes 2. change to not rely on #1252 3. minor refactoring in kustomize to align better with the other examples **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. --> **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. --> --------- Co-authored-by: Jimmi Dyson <[email protected]>
1 parent b70ffab commit 376cfd4

File tree

18 files changed

+588
-0
lines changed

18 files changed

+588
-0
lines changed
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
apiVersion: cluster.x-k8s.io/v1beta1
2+
kind: ClusterClass
3+
metadata:
4+
labels:
5+
cluster.x-k8s.io/provider: eks
6+
name: eks-quick-start
7+
spec:
8+
controlPlane:
9+
ref:
10+
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
11+
kind: AWSManagedControlPlaneTemplate
12+
name: eks-quick-start-control-plane
13+
infrastructure:
14+
ref:
15+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
16+
kind: AWSManagedClusterTemplate
17+
name: eks-quick-start
18+
patches:
19+
- external:
20+
discoverVariablesExtension: eksclusterconfigvars-dv.cluster-api-runtime-extensions-nutanix
21+
generateExtension: eksclusterv4configpatch-gp.cluster-api-runtime-extensions-nutanix
22+
name: cluster-config
23+
- external:
24+
discoverVariablesExtension: eksworkerconfigvars-dv.cluster-api-runtime-extensions-nutanix
25+
generateExtension: eksworkerv4configpatch-gp.cluster-api-runtime-extensions-nutanix
26+
name: worker-config
27+
- definitions:
28+
- jsonPatches:
29+
- op: add
30+
path: /spec/template/spec/identityRef
31+
value:
32+
kind: AWSClusterControllerIdentity
33+
name: default
34+
selector:
35+
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
36+
kind: AWSManagedControlPlaneTemplate
37+
matchResources:
38+
controlPlane: true
39+
description: AWSClusterStaticIdentity identityRef to use when creating the cluster
40+
name: identityRef
41+
workers:
42+
machineDeployments:
43+
- class: default-worker
44+
template:
45+
bootstrap:
46+
ref:
47+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
48+
kind: EKSConfigTemplate
49+
name: eks-quick-start-worker-configtemplate
50+
infrastructure:
51+
ref:
52+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
53+
kind: AWSMachineTemplate
54+
name: eks-quick-start-worker-machinetemplate
55+
---
56+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
57+
kind: AWSManagedClusterTemplate
58+
metadata:
59+
labels:
60+
cluster.x-k8s.io/provider: eks
61+
name: eks-quick-start
62+
spec:
63+
template:
64+
spec: {}
65+
---
66+
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
67+
kind: AWSManagedControlPlaneTemplate
68+
metadata:
69+
labels:
70+
cluster.x-k8s.io/provider: eks
71+
name: eks-quick-start-control-plane
72+
spec:
73+
template:
74+
spec:
75+
bootstrapSelfManagedAddons: false
76+
kubeProxy:
77+
disable: true
78+
vpcCni:
79+
disable: true
80+
---
81+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
82+
kind: AWSMachineTemplate
83+
metadata:
84+
labels:
85+
cluster.x-k8s.io/provider: eks
86+
name: eks-quick-start-worker-machinetemplate
87+
spec:
88+
template:
89+
spec:
90+
instanceType: PLACEHOLDER
91+
sshKeyName: ""
92+
---
93+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
94+
kind: EKSConfigTemplate
95+
metadata:
96+
labels:
97+
cluster.x-k8s.io/provider: eks
98+
name: eks-quick-start-worker-configtemplate
99+
spec:
100+
template:
101+
spec: {}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright 2025 Nutanix. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
{{- if and .Values.deployDefaultClusterClasses (.Capabilities.APIVersions.Has "infrastructure.cluster.x-k8s.io/v1beta2/AWSManagedClusterTemplate") }}
5+
{{ .Files.Get "defaultclusterclasses/eks-cluster-class.yaml" }}
6+
{{- end}}
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
apiVersion: v1
2+
data:
3+
values.yaml: |-
4+
cni:
5+
exclusive: false
6+
hubble:
7+
enabled: true
8+
tls:
9+
auto:
10+
enabled: true # enable automatic TLS certificate generation
11+
method: cronJob # auto generate certificates using cronJob method
12+
certValidityDuration: 60 # certificates validity duration in days (default 2 months)
13+
schedule: "0 0 1 * *" # schedule on the 1st day regeneration of each month
14+
relay:
15+
enabled: true
16+
tls:
17+
server:
18+
enabled: true
19+
mtls: true
20+
image:
21+
useDigest: false
22+
priorityClassName: system-cluster-critical
23+
image:
24+
useDigest: false
25+
operator:
26+
image:
27+
useDigest: false
28+
certgen:
29+
image:
30+
useDigest: false
31+
socketLB:
32+
hostNamespaceOnly: true
33+
envoy:
34+
image:
35+
useDigest: false
36+
kubeProxyReplacement: true
37+
k8sServiceHost: "{{ trimPrefix "https://" .Cluster.spec.controlPlaneEndpoint.host }}"
38+
k8sServicePort: "{{ .Cluster.spec.controlPlaneEndpoint.port }}"
39+
ipam:
40+
mode: eni
41+
enableIPv4Masquerade: false
42+
eni:
43+
enabled: true
44+
awsReleaseExcessIPs: true
45+
routingMode: native
46+
endpointRoutes:
47+
enabled: true
48+
kind: ConfigMap
49+
metadata:
50+
labels:
51+
cluster.x-k8s.io/provider: eks
52+
name: ${CLUSTER_NAME}-cilium-cni-helm-values-template
53+
---
54+
apiVersion: cluster.x-k8s.io/v1beta1
55+
kind: Cluster
56+
metadata:
57+
annotations:
58+
preflight.cluster.caren.nutanix.com/skip: all
59+
labels:
60+
cluster.x-k8s.io/provider: eks
61+
name: ${CLUSTER_NAME}
62+
spec:
63+
topology:
64+
class: eks-quick-start
65+
controlPlane:
66+
metadata:
67+
annotations:
68+
controlplane.cluster.x-k8s.io/skip-kube-proxy: ""
69+
variables:
70+
- name: clusterConfig
71+
value:
72+
addons:
73+
clusterAutoscaler: {}
74+
cni:
75+
provider: Cilium
76+
values:
77+
sourceRef:
78+
kind: ConfigMap
79+
name: ${CLUSTER_NAME}-cilium-cni-helm-values-template
80+
csi:
81+
defaultStorage:
82+
provider: aws-ebs
83+
storageClassConfig: default
84+
providers:
85+
aws-ebs:
86+
storageClassConfigs:
87+
default: {}
88+
snapshotController: {}
89+
nfd: {}
90+
eks:
91+
region: us-west-2
92+
version: ${KUBERNETES_VERSION}
93+
workers:
94+
machineDeployments:
95+
- class: default-worker
96+
metadata:
97+
annotations:
98+
cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "${WORKER_MACHINE_COUNT}"
99+
cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "${WORKER_MACHINE_COUNT}"
100+
name: md-0
101+
variables:
102+
overrides:
103+
- name: workerConfig
104+
value:
105+
eks:
106+
instanceType: m5.2xlarge
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Copyright 2025 Nutanix. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
apiVersion: v1
5+
data:
6+
values.yaml: |-
7+
cni:
8+
exclusive: false
9+
hubble:
10+
enabled: true
11+
tls:
12+
auto:
13+
enabled: true # enable automatic TLS certificate generation
14+
method: cronJob # auto generate certificates using cronJob method
15+
certValidityDuration: 60 # certificates validity duration in days (default 2 months)
16+
schedule: "0 0 1 * *" # schedule on the 1st day regeneration of each month
17+
relay:
18+
enabled: true
19+
tls:
20+
server:
21+
enabled: true
22+
mtls: true
23+
image:
24+
useDigest: false
25+
priorityClassName: system-cluster-critical
26+
image:
27+
useDigest: false
28+
operator:
29+
image:
30+
useDigest: false
31+
certgen:
32+
image:
33+
useDigest: false
34+
socketLB:
35+
hostNamespaceOnly: true
36+
envoy:
37+
image:
38+
useDigest: false
39+
kubeProxyReplacement: true
40+
k8sServiceHost: "{{ trimPrefix "https://" .Cluster.spec.controlPlaneEndpoint.host }}"
41+
k8sServicePort: "{{ .Cluster.spec.controlPlaneEndpoint.port }}"
42+
ipam:
43+
mode: eni
44+
enableIPv4Masquerade: false
45+
eni:
46+
enabled: true
47+
awsReleaseExcessIPs: true
48+
routingMode: native
49+
endpointRoutes:
50+
enabled: true
51+
kind: ConfigMap
52+
metadata:
53+
labels:
54+
cluster.x-k8s.io/provider: eks
55+
name: ${CLUSTER_NAME}-cilium-cni-helm-values-template
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
apiVersion: cluster.x-k8s.io/v1beta1
3+
kind: Cluster
4+
metadata:
5+
name: ${CLUSTER_NAME}
6+
annotations:
7+
preflight.cluster.caren.nutanix.com/skip: all
8+
spec:
9+
topology:
10+
class: eks-quick-start
11+
version: ${KUBERNETES_VERSION}
12+
variables: []
13+
controlPlane: {}
14+
workers:
15+
machineDeployments:
16+
- class: default-worker
17+
name: md-0
18+
replicas: ${WORKER_MACHINE_COUNT}
19+
variables:
20+
overrides:
21+
- name: workerConfig
22+
value: {}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright 2025 Nutanix. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
apiVersion: kustomize.config.k8s.io/v1beta1
5+
kind: Kustomization
6+
7+
resources:
8+
- cluster.yaml
9+
10+
sortOptions:
11+
order: fifo
12+
13+
labels:
14+
- includeSelectors: false
15+
pairs:
16+
cluster.x-k8s.io/provider: eks
17+
18+
patches:
19+
- target:
20+
kind: Cluster
21+
patch: |-
22+
- op: "add"
23+
path: "/spec/topology/class"
24+
value: "eks-quick-start"
25+
- target:
26+
kind: Cluster
27+
path: ../../../patches/eks/initialize-variables.yaml
28+
- target:
29+
kind: Cluster
30+
path: ../../../patches/cluster-autoscaler.yaml
31+
- target:
32+
kind: Cluster
33+
path: ../../../patches/eks/csi.yaml
34+
- target:
35+
kind: Cluster
36+
path: ../../../patches/eks/config-var.yaml
37+
- target:
38+
kind: Cluster
39+
path: ../../../patches/eks/instance-type.yaml

0 commit comments

Comments
 (0)