Skip to content

Commit 2131f60

Browse files
committed
fixup!: refactor: set variables with kustomize patches
This aligns the EKS example closer to how the rest of the examples are generated.
1 parent 228ea00 commit 2131f60

File tree

7 files changed

+91
-79
lines changed

7 files changed

+91
-79
lines changed
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: 3 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,3 @@
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-
name: ${CLUSTER_NAME}-cilium-cni-helm-values-template
511
---
522
apiVersion: cluster.x-k8s.io/v1beta1
533
kind: Cluster
@@ -59,20 +9,8 @@ spec:
599
topology:
6010
class: eks-quick-start
6111
version: ${KUBERNETES_VERSION}
62-
variables:
63-
- name: clusterConfig
64-
value:
65-
addons:
66-
cni:
67-
provider: Cilium
68-
values:
69-
sourceRef:
70-
name: ${CLUSTER_NAME}-cilium-cni-helm-values-template
71-
kind: ConfigMap
72-
controlPlane:
73-
metadata:
74-
annotations:
75-
controlplane.cluster.x-k8s.io/skip-kube-proxy: ""
12+
variables: []
13+
controlPlane: {}
7614
workers:
7715
machineDeployments:
7816
- class: default-worker
@@ -81,6 +19,4 @@ spec:
8119
variables:
8220
overrides:
8321
- name: workerConfig
84-
value:
85-
eks:
86-
instanceType: m5.2xlarge
22+
value: {}

hack/examples/bases/eks/cluster/kustomization.yaml.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,7 @@ patches:
3434
- target:
3535
kind: Cluster
3636
path: ../../../patches/eks/config-var.yaml
37+
- target:
38+
kind: Cluster
39+
path: ../../../patches/eks/instance-type.yaml
40+

hack/examples/overlays/clusters/eks/kustomization.yaml.tmpl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,17 @@ apiVersion: kustomize.config.k8s.io/v1beta1
55
kind: Kustomization
66

77
resources:
8+
- ../../../additional-resources/eks/cilium-configmap.yaml
89
- ../../../bases/eks/cluster
910

1011
sortOptions:
1112
order: fifo
13+
14+
patches:
15+
# TODO: Replace with generic cilium patch and dynamically generate the correct EKS values
16+
- target:
17+
kind: Cluster
18+
path: ../../../patches/eks/cilium-with-custom-values.yaml
19+
- target:
20+
kind: Cluster
21+
path: ../../../patches/skip-kube-proxy.yaml

hack/examples/patches/eks/ami-lookup.yaml

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright 2025 Nutanix. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
- op: "add"
5+
path: "/spec/topology/variables/0/value/addons/cni"
6+
value:
7+
provider: Cilium
8+
values:
9+
sourceRef:
10+
name: ${CLUSTER_NAME}-cilium-cni-helm-values-template
11+
kind: ConfigMap
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright 2025 Nutanix. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
- op: "add"
5+
path: "/spec/topology/workers/machineDeployments/0/variables/overrides/0/value"
6+
value:
7+
eks:
8+
instanceType: m5.2xlarge

0 commit comments

Comments
 (0)