-
Notifications
You must be signed in to change notification settings - Fork 0
/
cluster-template-openstack.yaml
128 lines (128 loc) · 3.75 KB
/
cluster-template-openstack.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# Based on: https://github.com/kubernetes-sigs/cluster-api-provider-openstack/releases/download/v0.6.3/cluster-template.yaml
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: ${CLUSTER_NAME}
spec:
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7
kind: OpenStackCluster
name: ${CLUSTER_NAME}
controlPlaneRef:
kind: MicroK8sControlPlane
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
name: ${CLUSTER_NAME}-control-plane
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7
kind: OpenStackCluster
metadata:
name: ${CLUSTER_NAME}
spec:
apiServerLoadBalancer:
enabled: ${OPENSTACK_USE_OCTAVIA_LOADBALANCER}
cloudName: ${OPENSTACK_CLOUD}
identityRef:
name: ${OPENSTACK_CLOUD_CONFIG_SECRET_NAME}
kind: Secret
nodeCidr: ${OPENSTACK_NETWORK_CIDR}
disablePortSecurity: true
dnsNameservers: [${OPENSTACK_DNS_NAMESERVERS:= }]
externalNetworkId: ${OPENSTACK_EXTERNAL_NETWORK_ID:=""}
---
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: MicroK8sControlPlane
metadata:
name: "${CLUSTER_NAME}-control-plane"
spec:
controlPlaneConfig:
initConfiguration:
joinTokenTTLInSecs: 900000
addons:
- dns
- ingress
httpProxy: "${CONTAINERD_HTTP_PROXY:=}"
httpsProxy: "${CONTAINERD_HTTPS_PROXY:=}"
noProxy: "${CONTAINERD_NO_PROXY:=}"
riskLevel: "${SNAP_RISKLEVEL:=}"
confinement: "${SNAP_CONFINEMENT:=}"
clusterConfiguration:
portCompatibilityRemap: true
machineTemplate:
infrastructureTemplate:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7
kind: OpenStackMachineTemplate
name: "${CLUSTER_NAME}-control-plane"
replicas: ${CONTROL_PLANE_MACHINE_COUNT:=1}
version: "v${KUBERNETES_VERSION}"
upgradeStrategy: "${UPGRADE_STRATEGY}"
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7
kind: OpenStackMachineTemplate
metadata:
name: ${CLUSTER_NAME}-control-plane
spec:
template:
spec:
flavor: ${OPENSTACK_CONTROL_PLANE_MACHINE_FLAVOR}
image: ${OPENSTACK_IMAGE_NAME}
sshKeyName: ${OPENSTACK_SSH_KEY_NAME}
cloudName: ${OPENSTACK_CLOUD}
identityRef:
name: ${OPENSTACK_CLOUD_CONFIG_SECRET_NAME}
kind: Secret
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineDeployment
metadata:
name: "${CLUSTER_NAME}-md-0"
spec:
clusterName: "${CLUSTER_NAME}"
replicas: ${WORKER_MACHINE_COUNT:=1}
selector:
matchLabels:
template:
spec:
clusterName: "${CLUSTER_NAME}"
version: "${KUBERNETES_VERSION}"
failureDomain: ${OPENSTACK_FAILURE_DOMAIN:=nova}
bootstrap:
configRef:
name: "${CLUSTER_NAME}-md-0"
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: MicroK8sConfigTemplate
infrastructureRef:
name: "${CLUSTER_NAME}-md-0"
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7
kind: OpenStackMachineTemplate
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7
kind: OpenStackMachineTemplate
metadata:
name: ${CLUSTER_NAME}-md-0
spec:
template:
spec:
cloudName: ${OPENSTACK_CLOUD}
identityRef:
name: ${OPENSTACK_CLOUD_CONFIG_SECRET_NAME}
kind: Secret
flavor: ${OPENSTACK_NODE_MACHINE_FLAVOR}
image: ${OPENSTACK_IMAGE_NAME}
sshKeyName: ${OPENSTACK_SSH_KEY_NAME}
---
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: MicroK8sConfigTemplate
metadata:
name: "${CLUSTER_NAME}-md-0"
spec:
template:
spec:
clusterConfiguration:
portCompatibilityRemap: true
initConfiguration:
httpProxy: "${CONTAINERD_HTTP_PROXY:=}"
httpsProxy: "${CONTAINERD_HTTPS_PROXY:=}"
noProxy: "${CONTAINERD_NO_PROXY:=}"
riskLevel: "${SNAP_RISKLEVEL:=}"
confinement: "${SNAP_CONFINEMENT:=}"