Skip to content

Commit 7961037

Browse files
committed
test: add clusterclass template back
Signed-off-by: Carlos Salas <[email protected]>
1 parent d3a98c8 commit 7961037

File tree

2 files changed

+169
-0
lines changed

2 files changed

+169
-0
lines changed

test/e2e/config/gcp-ci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ providers:
6767
- sourcePath: "${PWD}/test/e2e/data/infrastructure-gcp/cluster-template-md-remediation.yaml"
6868
- sourcePath: "${PWD}/test/e2e/data/infrastructure-gcp/cluster-template-kcp-remediation.yaml"
6969
- sourcePath: "${PWD}/test/e2e/data/infrastructure-gcp/cluster-template-ci-topology.yaml"
70+
- sourcePath: "${PWD}/test/e2e/data/infrastructure-gcp/clusterclass-quick-start.yaml"
7071
- sourcePath: "${PWD}/test/e2e/data/infrastructure-gcp/cluster-template-ci-with-creds.yaml"
7172
- sourcePath: "${PWD}/test/e2e/data/infrastructure-gcp/cluster-template-ci-gke.yaml"
7273
- sourcePath: "${PWD}/test/e2e/data/infrastructure-gcp/cluster-template-ci-gke-autopilot.yaml"
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
---
2+
apiVersion: cluster.x-k8s.io/v1beta1
3+
kind: ClusterClass
4+
metadata:
5+
name: quick-start
6+
spec:
7+
controlPlane:
8+
ref:
9+
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
10+
kind: KubeadmControlPlaneTemplate
11+
name: quick-start-control-plane
12+
machineInfrastructure:
13+
ref:
14+
kind: GCPMachineTemplate
15+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
16+
name: quick-start-control-plane
17+
infrastructure:
18+
ref:
19+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
20+
kind: GCPClusterTemplate
21+
name: quick-start
22+
workers:
23+
machineDeployments:
24+
- class: default-worker
25+
template:
26+
bootstrap:
27+
ref:
28+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
29+
kind: KubeadmConfigTemplate
30+
name: quick-start-worker-bootstraptemplate
31+
infrastructure:
32+
ref:
33+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
34+
kind: GCPMachineTemplate
35+
name: quick-start-worker-machinetemplate
36+
variables:
37+
- name: region
38+
required: true
39+
schema:
40+
openAPIV3Schema:
41+
type: string
42+
default: us-west1
43+
- name: controlPlaneMachineType
44+
required: true
45+
schema:
46+
openAPIV3Schema:
47+
type: string
48+
default: n1-standard-2
49+
- name: workerMachineType
50+
required: true
51+
schema:
52+
openAPIV3Schema:
53+
type: string
54+
default: n1-standard-2
55+
patches:
56+
- name: region
57+
definitions:
58+
- selector:
59+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
60+
kind: GCPClusterTemplate
61+
matchResources:
62+
infrastructureCluster: true
63+
jsonPatches:
64+
- op: add
65+
path: /spec/template/spec/region
66+
valueFrom:
67+
variable: region
68+
- name: controlPlaneMachineType
69+
definitions:
70+
- selector:
71+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
72+
kind: GCPMachineTemplate
73+
matchResources:
74+
controlPlane: true
75+
jsonPatches:
76+
- op: replace
77+
path: /spec/template/spec/instanceType
78+
valueFrom:
79+
variable: controlPlaneMachineType
80+
- name: workerMachineType
81+
definitions:
82+
- selector:
83+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
84+
kind: GCPMachineTemplate
85+
matchResources:
86+
machineDeploymentClass:
87+
names:
88+
- default-worker
89+
jsonPatches:
90+
- op: replace
91+
path: /spec/template/spec/instanceType
92+
valueFrom:
93+
variable: workerMachineType
94+
---
95+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
96+
kind: GCPClusterTemplate
97+
metadata:
98+
name: quick-start
99+
spec:
100+
template:
101+
spec:
102+
project: "${GCP_PROJECT}"
103+
region: "${GCP_REGION}"
104+
network:
105+
name: "${GCP_NETWORK_NAME}"
106+
---
107+
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
108+
kind: KubeadmControlPlaneTemplate
109+
metadata:
110+
name: quick-start-control-plane
111+
spec:
112+
template:
113+
spec:
114+
kubeadmConfigSpec:
115+
useExperimentalRetryJoin: true
116+
initConfiguration:
117+
nodeRegistration:
118+
name: '{{ ds.meta_data.local_hostname.split(".")[0] }}'
119+
kubeletExtraArgs:
120+
cloud-provider: gce
121+
clusterConfiguration:
122+
apiServer:
123+
timeoutForControlPlane: 20m
124+
extraArgs:
125+
cloud-provider: gce
126+
controllerManager:
127+
extraArgs:
128+
cloud-provider: gce
129+
allocate-node-cidrs: "false"
130+
joinConfiguration:
131+
nodeRegistration:
132+
name: '{{ ds.meta_data.local_hostname.split(".")[0] }}'
133+
kubeletExtraArgs:
134+
cloud-provider: gce
135+
---
136+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
137+
kind: GCPMachineTemplate
138+
metadata:
139+
name: quick-start-control-plane
140+
spec:
141+
template:
142+
spec:
143+
instanceType: REPLACEME
144+
image: "${IMAGE_ID}"
145+
---
146+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
147+
kind: GCPMachineTemplate
148+
metadata:
149+
name: quick-start-worker-machinetemplate
150+
spec:
151+
template:
152+
spec:
153+
instanceType: REPLACEME
154+
image: "${IMAGE_ID}"
155+
---
156+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
157+
kind: KubeadmConfigTemplate
158+
metadata:
159+
name: quick-start-worker-bootstraptemplate
160+
spec:
161+
template:
162+
spec:
163+
joinConfiguration:
164+
nodeRegistration:
165+
name: '{{ ds.meta_data.local_hostname.split(".")[0] }}'
166+
kubeletExtraArgs:
167+
cloud-provider: gce
168+

0 commit comments

Comments
 (0)