-
Notifications
You must be signed in to change notification settings - Fork 15
/
cluster-template-maas.yaml
101 lines (101 loc) · 2.74 KB
/
cluster-template-maas.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
# Based on https://github.com/spectrocloud/cluster-api-provider-maas/blob/v4.0.2-spectro/templates/cluster-template.yaml
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: ${CLUSTER_NAME}
spec:
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: MaasCluster
name: ${CLUSTER_NAME}
controlPlaneRef:
kind: MicroK8sControlPlane
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
name: ${CLUSTER_NAME}-control-plane
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: MaasCluster
metadata:
name: ${CLUSTER_NAME}
spec:
dnsDomain: ${MAAS_DNS_DOMAIN}
---
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: MicroK8sControlPlane
metadata:
name: "${CLUSTER_NAME}-control-plane"
spec:
controlPlaneConfig:
initConfiguration:
joinTokenTTLInSecs: 9000
IPinIP: true
addons:
- dns
- ingress
clusterConfiguration:
portCompatibilityRemap: true
machineTemplate:
infrastructureTemplate:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: MaasMachineTemplate
name: "${CLUSTER_NAME}-control-plane"
replicas: ${CONTROL_PLANE_MACHINE_COUNT:=1}
version: "v${KUBERNETES_VERSION}"
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: MaasMachineTemplate
metadata:
name: "${CLUSTER_NAME}-control-plane"
spec:
template:
spec:
minCPU: ${CONTROL_PLANE_MACHINE_MINCPU}
minMemory: ${CONTROL_PLANE_MACHINE_MINMEMORY}
image: ${CONTROL_PLANE_MACHINE_IMAGE}
resourcePool: ${CONTROL_PLANE_MACHINE_RESOURCEPOOL:= }
tags: [ ${CONTROL_PLANE_MACHINE_TAGS:= } ]
---
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}"
bootstrap:
configRef:
name: "${CLUSTER_NAME}-md-0"
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: MicroK8sConfigTemplate
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: MaasMachineTemplate
name: "${CLUSTER_NAME}-md-0"
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: MaasMachineTemplate
metadata:
name: "${CLUSTER_NAME}-md-0"
spec:
template:
spec:
minCPU: ${WORKER_MACHINE_MINCPU}
minMemory: ${WORKER_MACHINE_MINMEMORY}
image: ${WORKER_MACHINE_IMAGE}
resourcePool: ${WORKER_MACHINE_RESOURCEPOOL:= }
tags: [ ${WORKER_MACHINE_TAGS:= } ]
---
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: MicroK8sConfigTemplate
metadata:
name: "${CLUSTER_NAME}-md-0"
spec:
template:
spec: {}