Skip to content

Commit 95d2b13

Browse files
author
Joshua Reed
committed
Initial attempt to convert e2e templates.
1 parent 275412f commit 95d2b13

File tree

69 files changed

+3773
-0
lines changed

Some content is hidden

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

69 files changed

+3773
-0
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
apiVersion: cluster.x-k8s.io/v1beta1
3+
kind: Cluster
4+
metadata:
5+
name: ${CLUSTER_NAME}
6+
spec:
7+
clusterNetwork:
8+
pods:
9+
cidrBlocks:
10+
- 192.168.0.0/16
11+
serviceDomain: "cluster.local"
12+
infrastructureRef:
13+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
14+
kind: CloudStackCluster
15+
name: ${CLUSTER_NAME}
16+
controlPlaneRef:
17+
kind: KubeadmControlPlane
18+
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
19+
name: ${CLUSTER_NAME}-control-plane
20+
---
21+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
22+
kind: CloudStackCluster
23+
metadata:
24+
name: ${CLUSTER_NAME}
25+
spec:
26+
zones:
27+
- name : ${CLOUDSTACK_ZONE_NAME}
28+
network:
29+
name: ${CLOUDSTACK_NETWORK_NAME}
30+
controlPlaneEndpoint:
31+
host: ""
32+
port: 6443
33+
---
34+
kind: KubeadmControlPlane
35+
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
36+
metadata:
37+
name: ${CLUSTER_NAME}-control-plane
38+
spec:
39+
kubeadmConfigSpec:
40+
initConfiguration:
41+
nodeRegistration:
42+
name: '{{ local_hostname }}'
43+
kubeletExtraArgs:
44+
provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}'
45+
clusterConfiguration:
46+
imageRepository: k8s.gcr.io
47+
joinConfiguration:
48+
nodeRegistration:
49+
name: '{{ local_hostname }}'
50+
kubeletExtraArgs:
51+
provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}'
52+
preKubeadmCommands:
53+
- swapoff -a
54+
machineTemplate:
55+
infrastructureRef:
56+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
57+
kind: CloudStackMachineTemplate
58+
name: ${CLUSTER_NAME}-control-plane
59+
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
60+
version: ${KUBERNETES_VERSION}
61+
---
62+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
63+
kind: CloudStackMachineTemplate
64+
metadata:
65+
name: ${CLUSTER_NAME}-control-plane
66+
spec:
67+
template:
68+
spec:
69+
offering:
70+
name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING}
71+
template:
72+
name: ${CLOUDSTACK_TEMPLATE_NAME}
73+
sshKey: ${CLOUDSTACK_SSH_KEY_NAME}
74+
---
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
apiVersion: cluster.x-k8s.io/v1beta1
3+
kind: MachineDeployment
4+
metadata:
5+
name: "${CLUSTER_NAME}-md-0"
6+
spec:
7+
clusterName: "${CLUSTER_NAME}"
8+
replicas: ${WORKER_MACHINE_COUNT}
9+
selector:
10+
matchLabels: null
11+
template:
12+
spec:
13+
clusterName: "${CLUSTER_NAME}"
14+
version: ${KUBERNETES_VERSION}
15+
bootstrap:
16+
configRef:
17+
name: "${CLUSTER_NAME}-md-0"
18+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
19+
kind: KubeadmConfigTemplate
20+
infrastructureRef:
21+
name: "${CLUSTER_NAME}-md-0"
22+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
23+
kind: CloudStackMachineTemplate
24+
---
25+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
26+
kind: CloudStackMachineTemplate
27+
metadata:
28+
name: ${CLUSTER_NAME}-md-0
29+
spec:
30+
template:
31+
spec:
32+
offering:
33+
name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING}
34+
template:
35+
name: ${CLOUDSTACK_TEMPLATE_NAME}
36+
sshKey: ${CLOUDSTACK_SSH_KEY_NAME}
37+
---
38+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
39+
kind: KubeadmConfigTemplate
40+
metadata:
41+
name: ${CLUSTER_NAME}-md-0
42+
spec:
43+
template:
44+
spec:
45+
joinConfiguration:
46+
nodeRegistration:
47+
name: '{{ local_hostname }}'
48+
kubeletExtraArgs:
49+
provider-id: cloudstack:///'{{ ds.meta_data.instance_id }}'
50+
preKubeadmCommands:
51+
- swapoff -a
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
2+
kind: KubeadmConfigTemplate
3+
metadata:
4+
name: ${CLUSTER_NAME}-md-0
5+
spec:
6+
template:
7+
spec:
8+
joinConfiguration:
9+
nodeRegistration:
10+
kubeletExtraArgs:
11+
provider-id: "cloudstack:///'{{ ds.meta_data.instance_id }}'"
12+
name: '{{ local_hostname }}'
13+
preKubeadmCommands:
14+
- swapoff -a
15+
---
16+
apiVersion: cluster.x-k8s.io/v1beta1
17+
kind: Cluster
18+
metadata:
19+
name: ${CLUSTER_NAME}
20+
spec:
21+
clusterNetwork:
22+
pods:
23+
cidrBlocks:
24+
- 192.168.0.0/16
25+
serviceDomain: cluster.local
26+
controlPlaneRef:
27+
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
28+
kind: KubeadmControlPlane
29+
name: ${CLUSTER_NAME}-control-plane
30+
infrastructureRef:
31+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
32+
kind: CloudStackCluster
33+
name: ${CLUSTER_NAME}
34+
---
35+
apiVersion: cluster.x-k8s.io/v1beta1
36+
kind: MachineDeployment
37+
metadata:
38+
name: ${CLUSTER_NAME}-md-0
39+
spec:
40+
clusterName: ${CLUSTER_NAME}
41+
replicas: ${WORKER_MACHINE_COUNT}
42+
selector:
43+
matchLabels: null
44+
template:
45+
spec:
46+
bootstrap:
47+
configRef:
48+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
49+
kind: KubeadmConfigTemplate
50+
name: ${CLUSTER_NAME}-md-0
51+
clusterName: ${CLUSTER_NAME}
52+
infrastructureRef:
53+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
54+
kind: CloudStackMachineTemplate
55+
name: ${CLUSTER_NAME}-md-0
56+
version: ${KUBERNETES_VERSION}
57+
---
58+
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
59+
kind: KubeadmControlPlane
60+
metadata:
61+
name: ${CLUSTER_NAME}-control-plane
62+
spec:
63+
kubeadmConfigSpec:
64+
clusterConfiguration:
65+
imageRepository: k8s.gcr.io
66+
initConfiguration:
67+
nodeRegistration:
68+
kubeletExtraArgs:
69+
provider-id: "cloudstack:///'{{ ds.meta_data.instance_id }}'"
70+
name: '{{ local_hostname }}'
71+
joinConfiguration:
72+
nodeRegistration:
73+
kubeletExtraArgs:
74+
provider-id: "cloudstack:///'{{ ds.meta_data.instance_id }}'"
75+
name: '{{ local_hostname }}'
76+
preKubeadmCommands:
77+
- swapoff -a
78+
machineTemplate:
79+
infrastructureRef:
80+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
81+
kind: CloudStackMachineTemplate
82+
name: ${CLUSTER_NAME}-control-plane
83+
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
84+
version: ${KUBERNETES_VERSION}
85+
---
86+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
87+
kind: CloudStackCluster
88+
metadata:
89+
name: ${CLUSTER_NAME}
90+
spec:
91+
controlPlaneEndpoint:
92+
host: ""
93+
port: 6443
94+
failureDomains:
95+
- name: ${CLOUDSTACK_FD1_NAME}
96+
zone:
97+
name : ${CLOUDSTACK_ZONE_NAME}
98+
network:
99+
name: ${CLOUDSTACK_NETWORK_NAME}
100+
acsendpoint:
101+
name: ${CLOUDSTACK_FD1_SECRET_NAME}
102+
namespace: default
103+
---
104+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
105+
kind: CloudStackMachineTemplate
106+
metadata:
107+
name: ${CLUSTER_NAME}-control-plane
108+
spec:
109+
template:
110+
spec:
111+
affinity: anti
112+
offering:
113+
name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING}
114+
sshKey: ${CLOUDSTACK_SSH_KEY_NAME}
115+
template:
116+
name: ${CLOUDSTACK_TEMPLATE_NAME}
117+
---
118+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
119+
kind: CloudStackMachineTemplate
120+
metadata:
121+
name: ${CLUSTER_NAME}-md-0
122+
spec:
123+
template:
124+
spec:
125+
affinity: anti
126+
offering:
127+
name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING}
128+
sshKey: ${CLOUDSTACK_SSH_KEY_NAME}
129+
template:
130+
name: ${CLOUDSTACK_TEMPLATE_NAME}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
bases:
2+
- ../bases/cluster-with-kcp.yaml
3+
- ../bases/md.yaml
4+
5+
patchesStrategicMerge:
6+
- ./md.yaml
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
3+
kind: CloudStackMachineTemplate
4+
metadata:
5+
name: ${CLUSTER_NAME}-control-plane
6+
spec:
7+
template:
8+
spec:
9+
offering:
10+
name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING}
11+
template:
12+
name: ${CLOUDSTACK_TEMPLATE_NAME}
13+
sshKey: ${CLOUDSTACK_SSH_KEY_NAME}
14+
affinity: anti
15+
---
16+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
17+
kind: CloudStackMachineTemplate
18+
metadata:
19+
name: ${CLUSTER_NAME}-md-0
20+
spec:
21+
template:
22+
spec:
23+
offering:
24+
name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING}
25+
template:
26+
name: ${CLOUDSTACK_TEMPLATE_NAME}
27+
sshKey: ${CLOUDSTACK_SSH_KEY_NAME}
28+
affinity: anti

0 commit comments

Comments
 (0)