Skip to content

Commit cb89566

Browse files
authored
Merge pull request #158 from jweite-amazon/v1beta2-templates
Ported templates to v1beta2
2 parents 69942c4 + 78ddbca commit cb89566

5 files changed

+150
-125
lines changed

templates/cluster-template-managed-ssh.yaml

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,58 +8,61 @@ spec:
88
pods:
99
cidrBlocks:
1010
- 192.168.0.0/16
11-
serviceDomain: cluster.local
11+
serviceDomain: "cluster.local"
1212
infrastructureRef:
13-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
13+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
1414
kind: CloudStackCluster
1515
name: ${CLUSTER_NAME}
1616
controlPlaneRef:
1717
kind: KubeadmControlPlane
1818
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
1919
name: ${CLUSTER_NAME}-control-plane
2020
---
21-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
21+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
2222
kind: CloudStackCluster
2323
metadata:
2424
name: ${CLUSTER_NAME}
2525
spec:
2626
controlPlaneEndpoint:
2727
host: ${CLUSTER_ENDPOINT_IP}
28-
port: ${CLUSTER_ENDPOINT_PORT}
29-
zones:
30-
- name : ${CLOUDSTACK_ZONE_NAME}
31-
network:
32-
name: ${CLOUDSTACK_NETWORK_NAME}
28+
port: ${CLUSTER_ENDPOINT_PORT=6443}
29+
failureDomains:
30+
- name: ${CLOUDSTACK_FD1_NAME=failure-domain-1}
31+
acsEndpoint:
32+
name: ${CLOUDSTACK_FD1_SECRET_NAME=cloudstack-credentials}
33+
namespace: ${CLOUDSTACK_FD1_SECRET_NAMESPACE=default}
34+
zone:
35+
name: ${CLOUDSTACK_ZONE_NAME}
36+
network:
37+
name: ${CLOUDSTACK_NETWORK_NAME}
3338
---
34-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
3539
kind: KubeadmControlPlane
40+
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
3641
metadata:
3742
name: "${CLUSTER_NAME}-control-plane"
3843
spec:
3944
kubeadmConfigSpec:
40-
clusterConfiguration:
41-
imageRepository: k8s.gcr.io
4245
initConfiguration:
4346
nodeRegistration:
47+
name: '{{ local_hostname }}'
4448
kubeletExtraArgs:
4549
provider-id: "cloudstack:///'{{ ds.meta_data.instance_id }}'"
46-
name: '{{ local_hostname }}'
4750
joinConfiguration:
4851
nodeRegistration:
52+
name: '{{ local_hostname }}'
4953
kubeletExtraArgs:
5054
provider-id: "cloudstack:///'{{ ds.meta_data.instance_id }}'"
51-
name: '{{ local_hostname }}'
5255
preKubeadmCommands:
5356
- swapoff -a
5457
machineTemplate:
5558
infrastructureRef:
59+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
5660
kind: CloudStackMachineTemplate
57-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
5861
name: "${CLUSTER_NAME}-control-plane"
5962
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
6063
version: ${KUBERNETES_VERSION}
6164
---
62-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
65+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
6366
kind: CloudStackMachineTemplate
6467
metadata:
6568
name: ${CLUSTER_NAME}-control-plane
@@ -69,7 +72,7 @@ spec:
6972
sshKey: ${CLOUDSTACK_SSH_KEY_NAME}
7073
offering:
7174
name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING}
72-
template:
75+
template:
7376
name: ${CLOUDSTACK_TEMPLATE_NAME}
7477
---
7578
apiVersion: cluster.x-k8s.io/v1beta1
@@ -83,19 +86,19 @@ spec:
8386
matchLabels: null
8487
template:
8588
spec:
89+
clusterName: "${CLUSTER_NAME}"
90+
version: "${KUBERNETES_VERSION}"
8691
bootstrap:
8792
configRef:
93+
name: "${CLUSTER_NAME}-md-0"
8894
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
8995
kind: KubeadmConfigTemplate
90-
name: "${CLUSTER_NAME}-md-0"
91-
clusterName: "${CLUSTER_NAME}"
9296
infrastructureRef:
9397
name: "${CLUSTER_NAME}-md-0"
94-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
98+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
9599
kind: CloudStackMachineTemplate
96-
version: ${KUBERNETES_VERSION}
97100
---
98-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
101+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
99102
kind: CloudStackMachineTemplate
100103
metadata:
101104
name: ${CLUSTER_NAME}-md-0
@@ -105,7 +108,7 @@ spec:
105108
sshKey: ${CLOUDSTACK_SSH_KEY_NAME}
106109
offering:
107110
name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING}
108-
template:
111+
template:
109112
name: ${CLOUDSTACK_TEMPLATE_NAME}
110113
---
111114
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
@@ -117,8 +120,8 @@ spec:
117120
spec:
118121
joinConfiguration:
119122
nodeRegistration:
123+
name: '{{ local_hostname }}'
120124
kubeletExtraArgs:
121125
provider-id: "cloudstack:///'{{ ds.meta_data.instance_id }}'"
122-
name: '{{ local_hostname }}'
123126
preKubeadmCommands:
124127
- swapoff -a

templates/cluster-template-ssh-material.yaml

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,47 +8,50 @@ spec:
88
pods:
99
cidrBlocks:
1010
- 192.168.0.0/16
11-
serviceDomain: cluster.local
11+
serviceDomain: "cluster.local"
1212
infrastructureRef:
13-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
13+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
1414
kind: CloudStackCluster
1515
name: ${CLUSTER_NAME}
1616
controlPlaneRef:
1717
kind: KubeadmControlPlane
1818
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
1919
name: ${CLUSTER_NAME}-control-plane
2020
---
21-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
21+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
2222
kind: CloudStackCluster
2323
metadata:
2424
name: ${CLUSTER_NAME}
2525
spec:
2626
controlPlaneEndpoint:
2727
host: ${CLUSTER_ENDPOINT_IP}
28-
port: ${CLUSTER_ENDPOINT_PORT}
29-
zones:
30-
- name : ${CLOUDSTACK_ZONE_NAME}
31-
network:
32-
name: ${CLOUDSTACK_NETWORK_NAME}
28+
port: ${CLUSTER_ENDPOINT_PORT=6443}
29+
failureDomains:
30+
- name: ${CLOUDSTACK_FD1_NAME=failure-domain-1}
31+
acsEndpoint:
32+
name: ${CLOUDSTACK_FD1_SECRET_NAME=cloudstack-credentials}
33+
namespace: ${CLOUDSTACK_FD1_SECRET_NAMESPACE=default}
34+
zone:
35+
name: ${CLOUDSTACK_ZONE_NAME}
36+
network:
37+
name: ${CLOUDSTACK_NETWORK_NAME}
3338
---
34-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
3539
kind: KubeadmControlPlane
40+
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
3641
metadata:
3742
name: "${CLUSTER_NAME}-control-plane"
3843
spec:
3944
kubeadmConfigSpec:
40-
clusterConfiguration:
41-
imageRepository: k8s.gcr.io
4245
initConfiguration:
4346
nodeRegistration:
47+
name: '{{ local_hostname }}'
4448
kubeletExtraArgs:
4549
provider-id: "cloudstack:///'{{ ds.meta_data.instance_id }}'"
46-
name: '{{ local_hostname }}'
4750
joinConfiguration:
4851
nodeRegistration:
52+
name: '{{ local_hostname }}'
4953
kubeletExtraArgs:
5054
provider-id: "cloudstack:///'{{ ds.meta_data.instance_id }}'"
51-
name: '{{ local_hostname }}'
5255
users:
5356
- name: ${OS_USERID}
5457
sshAuthorizedKeys:
@@ -58,22 +61,22 @@ spec:
5861
- swapoff -a
5962
machineTemplate:
6063
infrastructureRef:
64+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
6165
kind: CloudStackMachineTemplate
62-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
6366
name: "${CLUSTER_NAME}-control-plane"
6467
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
6568
version: ${KUBERNETES_VERSION}
6669
---
67-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
70+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
6871
kind: CloudStackMachineTemplate
6972
metadata:
7073
name: ${CLUSTER_NAME}-control-plane
7174
spec:
7275
template:
7376
spec:
74-
offering:
77+
offering:
7578
name: ${CLOUDSTACK_CONTROL_PLANE_MACHINE_OFFERING}
76-
template:
79+
template:
7780
name: ${CLOUDSTACK_TEMPLATE_NAME}
7881
---
7982
apiVersion: cluster.x-k8s.io/v1beta1
@@ -87,28 +90,28 @@ spec:
8790
matchLabels: null
8891
template:
8992
spec:
93+
clusterName: "${CLUSTER_NAME}"
94+
version: "${KUBERNETES_VERSION}"
9095
bootstrap:
9196
configRef:
97+
name: "${CLUSTER_NAME}-md-0"
9298
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
9399
kind: KubeadmConfigTemplate
94-
name: "${CLUSTER_NAME}-md-0"
95-
clusterName: "${CLUSTER_NAME}"
96100
infrastructureRef:
97101
name: "${CLUSTER_NAME}-md-0"
98-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
102+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
99103
kind: CloudStackMachineTemplate
100-
version: ${KUBERNETES_VERSION}
101104
---
102-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
105+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
103106
kind: CloudStackMachineTemplate
104107
metadata:
105108
name: ${CLUSTER_NAME}-md-0
106109
spec:
107110
template:
108111
spec:
109-
offering:
112+
offering:
110113
name: ${CLOUDSTACK_WORKER_MACHINE_OFFERING}
111-
template:
114+
template:
112115
name: ${CLOUDSTACK_TEMPLATE_NAME}
113116
---
114117
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
@@ -120,9 +123,9 @@ spec:
120123
spec:
121124
joinConfiguration:
122125
nodeRegistration:
126+
name: '{{ local_hostname }}'
123127
kubeletExtraArgs:
124128
provider-id: "cloudstack:///'{{ ds.meta_data.instance_id }}'"
125-
name: '{{ local_hostname }}'
126129
users:
127130
- name: ${OS_USERID}
128131
sshAuthorizedKeys:

0 commit comments

Comments
 (0)