-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcluster-template.yaml
More file actions
123 lines (123 loc) · 3.22 KB
/
cluster-template.yaml
File metadata and controls
123 lines (123 loc) · 3.22 KB
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
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: ${CLUSTER_NAME}
namespace: ${NAMESPACE}
spec:
clusterNetwork:
pods:
cidrBlocks: ${POD_CIDR:=["10.240.0.0/12"]}
controlPlaneRef:
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
kind: KubeadmControlPlane
name: ${CLUSTER_NAME}-controlplane
namespace: ${NAMESPACE}
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: MetalStackCluster
name: ${CLUSTER_NAME}
namespace: ${NAMESPACE}
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: MetalStackCluster
metadata:
name: ${CLUSTER_NAME}
namespace: ${NAMESPACE}
spec:
projectID: ${METAL_PROJECT_ID}
partition: ${METAL_PARTITION}
nodeNetworkID: ${METAL_NODE_NETWORK_ID}
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: MetalStackMachineTemplate
metadata:
name: ${CLUSTER_NAME}-controlplane
namespace: ${NAMESPACE}
spec:
template:
spec:
size: ${CONTROL_PLANE_MACHINE_SIZE}
image: ${CONTROL_PLANE_MACHINE_IMAGE}
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
kind: MetalStackMachineTemplate
metadata:
name: ${CLUSTER_NAME}-worker
spec:
template:
spec:
size: ${WORKER_MACHINE_SIZE}
image: ${WORKER_MACHINE_IMAGE}
---
kind: KubeadmControlPlane
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
metadata:
name: ${CLUSTER_NAME}-controlplane
spec:
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
version: ${KUBERNETES_VERSION}
machineTemplate:
nodeDrainTimeout: 10m
infrastructureRef:
kind: MetalStackMachineTemplate
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha1
name: ${CLUSTER_NAME}-controlplane
kubeadmConfigSpec:
format: ignition
clusterConfiguration:
controlPlaneEndpoint: ${CONTROL_PLANE_ENDPOINT}
initConfiguration:
localAPIEndpoint:
advertiseAddress: 127.0.0.1
bindPort: ${CONTROL_PLANE_PORT:=443}
nodeRegistration: {}
joinConfiguration:
controlPlane: {}
nodeRegistration: {}
---
apiVersion: cluster.x-k8s.io/v1beta1
kind: MachineDeployment
metadata:
name: ${CLUSTER_NAME}-md-0
labels:
cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME}
nodepool: nodepool-0
spec:
clusterName: ${CLUSTER_NAME}
replicas: ${WORKER_MACHINE_COUNT}
selector:
matchLabels:
cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME}
nodepool: nodepool-0
template:
metadata:
labels:
cluster.x-k8s.io/cluster-name: ${CLUSTER_NAME}
nodepool: nodepool-0
spec:
nodeDrainTimeout: 120s
clusterName: ${CLUSTER_NAME}
version: "${KUBERNETES_VERSION}"
bootstrap:
configRef:
name: ${CLUSTER_NAME}-md-0
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
infrastructureRef:
name: ${CLUSTER_NAME}-worker
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: MetalStackMachineTemplate
---
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
kind: KubeadmConfigTemplate
metadata:
name: ${CLUSTER_NAME}-md-0
spec:
template:
spec:
format: ignition
clusterConfiguration:
controlPlaneEndpoint: ${CONTROL_PLANE_ENDPOINT}
joinConfiguration:
nodeRegistration: {}