Skip to content

Commit 5a881ea

Browse files
author
Cecile Robert-Michon
committed
Add template for kcp scale in capi e2e test
1 parent b951b0b commit 5a881ea

File tree

2 files changed

+222
-0
lines changed

2 files changed

+222
-0
lines changed

test/e2e/config/azure-dev.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ providers:
6363
targetName: "cluster-template-md-remediation.yaml"
6464
- sourcePath: "../data/infrastructure-azure/cluster-template-kcp-remediation.yaml"
6565
targetName: "cluster-template-kcp-remediation.yaml"
66+
- sourcePath: "../data/infrastructure-azure/cluster-template-kcp-scale-in.yaml"
67+
targetName: "cluster-template-kcp-scale-in.yaml"
6668
- sourcePath: "${PWD}/templates/test/ci/cluster-template-prow-machine-pool.yaml"
6769
targetName: "cluster-template-machine-pool.yaml"
6870
- sourcePath: "${PWD}/templates/test/ci/cluster-template-prow-nvidia-gpu.yaml"
Lines changed: 220 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,220 @@
1+
apiVersion: cluster.x-k8s.io/v1alpha4
2+
kind: Cluster
3+
metadata:
4+
labels:
5+
cni: ${CLUSTER_NAME}-crs-0
6+
name: ${CLUSTER_NAME}
7+
namespace: default
8+
spec:
9+
clusterNetwork:
10+
pods:
11+
cidrBlocks:
12+
- 192.168.0.0/16
13+
controlPlaneRef:
14+
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
15+
kind: KubeadmControlPlane
16+
name: ${CLUSTER_NAME}-control-plane
17+
infrastructureRef:
18+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
19+
kind: AzureCluster
20+
name: ${CLUSTER_NAME}
21+
---
22+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
23+
kind: AzureCluster
24+
metadata:
25+
name: ${CLUSTER_NAME}
26+
namespace: default
27+
spec:
28+
additionalTags:
29+
creationTimestamp: ${TIMESTAMP}
30+
jobName: ${JOB_NAME}
31+
location: ${AZURE_LOCATION}
32+
networkSpec:
33+
vnet:
34+
name: ${AZURE_VNET_NAME:=${CLUSTER_NAME}-vnet}
35+
resourceGroup: ${AZURE_RESOURCE_GROUP:=${CLUSTER_NAME}}
36+
subscriptionID: ${AZURE_SUBSCRIPTION_ID}
37+
---
38+
apiVersion: controlplane.cluster.x-k8s.io/v1alpha4
39+
kind: KubeadmControlPlane
40+
metadata:
41+
name: ${CLUSTER_NAME}-control-plane
42+
namespace: default
43+
spec:
44+
machineTemplate:
45+
infrastructureRef:
46+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
47+
kind: AzureMachineTemplate
48+
name: ${CLUSTER_NAME}-control-plane
49+
kubeadmConfigSpec:
50+
clusterConfiguration:
51+
apiServer:
52+
extraArgs:
53+
cloud-config: /etc/kubernetes/azure.json
54+
cloud-provider: azure
55+
extraVolumes:
56+
- hostPath: /etc/kubernetes/azure.json
57+
mountPath: /etc/kubernetes/azure.json
58+
name: cloud-config
59+
readOnly: true
60+
timeoutForControlPlane: 20m
61+
controllerManager:
62+
extraArgs:
63+
allocate-node-cidrs: "false"
64+
cloud-config: /etc/kubernetes/azure.json
65+
cloud-provider: azure
66+
cluster-name: ${CLUSTER_NAME}
67+
extraVolumes:
68+
- hostPath: /etc/kubernetes/azure.json
69+
mountPath: /etc/kubernetes/azure.json
70+
name: cloud-config
71+
readOnly: true
72+
etcd:
73+
local:
74+
dataDir: /var/lib/etcddisk/etcd
75+
diskSetup:
76+
filesystems:
77+
- device: /dev/disk/azure/scsi1/lun0
78+
extraOpts:
79+
- -E
80+
- lazy_itable_init=1,lazy_journal_init=1
81+
filesystem: ext4
82+
label: etcd_disk
83+
- device: ephemeral0.1
84+
filesystem: ext4
85+
label: ephemeral0
86+
replaceFS: ntfs
87+
partitions:
88+
- device: /dev/disk/azure/scsi1/lun0
89+
layout: true
90+
overwrite: false
91+
tableType: gpt
92+
files:
93+
- contentFrom:
94+
secret:
95+
key: control-plane-azure.json
96+
name: ${CLUSTER_NAME}-control-plane-azure-json
97+
owner: root:root
98+
path: /etc/kubernetes/azure.json
99+
permissions: "0644"
100+
initConfiguration:
101+
nodeRegistration:
102+
kubeletExtraArgs:
103+
cloud-config: /etc/kubernetes/azure.json
104+
cloud-provider: azure
105+
name: '{{ ds.meta_data["local_hostname"] }}'
106+
joinConfiguration:
107+
nodeRegistration:
108+
kubeletExtraArgs:
109+
cloud-config: /etc/kubernetes/azure.json
110+
cloud-provider: azure
111+
name: '{{ ds.meta_data["local_hostname"] }}'
112+
mounts:
113+
- - LABEL=etcd_disk
114+
- /var/lib/etcddisk
115+
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
116+
version: ${KUBERNETES_VERSION}
117+
---
118+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
119+
kind: AzureMachineTemplate
120+
metadata:
121+
name: ${CLUSTER_NAME}-control-plane
122+
namespace: default
123+
spec:
124+
template:
125+
spec:
126+
dataDisks:
127+
- diskSizeGB: 256
128+
lun: 0
129+
nameSuffix: etcddisk
130+
osDisk:
131+
diskSizeGB: 128
132+
managedDisk:
133+
storageAccountType: Premium_LRS
134+
osType: Linux
135+
sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""}
136+
vmSize: ${AZURE_CONTROL_PLANE_MACHINE_TYPE}
137+
---
138+
apiVersion: cluster.x-k8s.io/v1alpha4
139+
kind: MachineDeployment
140+
metadata:
141+
name: ${CLUSTER_NAME}-md-0
142+
namespace: default
143+
spec:
144+
clusterName: ${CLUSTER_NAME}
145+
replicas: ${WORKER_MACHINE_COUNT}
146+
selector:
147+
matchLabels: null
148+
template:
149+
spec:
150+
bootstrap:
151+
configRef:
152+
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4
153+
kind: KubeadmConfigTemplate
154+
name: ${CLUSTER_NAME}-md-0
155+
clusterName: ${CLUSTER_NAME}
156+
infrastructureRef:
157+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
158+
kind: AzureMachineTemplate
159+
name: ${CLUSTER_NAME}-md-0
160+
version: ${KUBERNETES_VERSION}
161+
---
162+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4
163+
kind: AzureMachineTemplate
164+
metadata:
165+
name: ${CLUSTER_NAME}-md-0
166+
namespace: default
167+
spec:
168+
template:
169+
spec:
170+
osDisk:
171+
diskSizeGB: 128
172+
managedDisk:
173+
storageAccountType: Premium_LRS
174+
osType: Linux
175+
sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""}
176+
vmSize: ${AZURE_NODE_MACHINE_TYPE}
177+
---
178+
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha4
179+
kind: KubeadmConfigTemplate
180+
metadata:
181+
name: ${CLUSTER_NAME}-md-0
182+
namespace: default
183+
spec:
184+
template:
185+
spec:
186+
files:
187+
- contentFrom:
188+
secret:
189+
key: worker-node-azure.json
190+
name: ${CLUSTER_NAME}-md-0-azure-json
191+
owner: root:root
192+
path: /etc/kubernetes/azure.json
193+
permissions: "0644"
194+
joinConfiguration:
195+
nodeRegistration:
196+
kubeletExtraArgs:
197+
cloud-config: /etc/kubernetes/azure.json
198+
cloud-provider: azure
199+
name: '{{ ds.meta_data["local_hostname"] }}'
200+
---
201+
apiVersion: v1
202+
data: ${CNI_RESOURCES}
203+
kind: ConfigMap
204+
metadata:
205+
name: cni-${CLUSTER_NAME}-crs-0
206+
namespace: default
207+
---
208+
apiVersion: addons.cluster.x-k8s.io/v1alpha4
209+
kind: ClusterResourceSet
210+
metadata:
211+
name: ${CLUSTER_NAME}-crs-0
212+
namespace: default
213+
spec:
214+
clusterSelector:
215+
matchLabels:
216+
cni: ${CLUSTER_NAME}-crs-0
217+
resources:
218+
- kind: ConfigMap
219+
name: cni-${CLUSTER_NAME}-crs-0
220+
strategy: ApplyOnce

0 commit comments

Comments
 (0)