Skip to content

Commit fd04773

Browse files
authored
Merge pull request #5157 from AndiDog/align-flatcar-template
🌱 Align `cluster-template.yaml` and `cluster-template-flatcar.yaml`
2 parents b99a49c + 477631e commit fd04773

File tree

1 file changed

+78
-35
lines changed

1 file changed

+78
-35
lines changed

templates/cluster-template-flatcar.yaml

+78-35
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
---
21
apiVersion: cluster.x-k8s.io/v1beta1
32
kind: Cluster
43
metadata:
54
labels:
65
ccm: external
76
csi: external
8-
name: ${CLUSTER_NAME}
7+
name: "${CLUSTER_NAME}"
98
spec:
109
clusterNetwork:
1110
pods:
12-
cidrBlocks: ["192.168.0.0/16"]
11+
cidrBlocks:
12+
- 192.168.0.0/16
13+
controlPlaneRef:
14+
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
15+
kind: KubeadmControlPlane
16+
name: "${CLUSTER_NAME}-control-plane"
1317
infrastructureRef:
1418
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
1519
kind: AWSCluster
1620
name: "${CLUSTER_NAME}"
17-
controlPlaneRef:
18-
kind: KubeadmControlPlane
19-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
20-
name: "${CLUSTER_NAME}-control-plane"
2121
---
2222
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
2323
kind: AWSCluster
@@ -35,27 +35,21 @@ spec:
3535
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
3636
kind: KubeadmControlPlane
3737
metadata:
38-
name: ${CLUSTER_NAME}-control-plane
38+
name: "${CLUSTER_NAME}-control-plane"
3939
spec:
40-
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
41-
machineTemplate:
42-
infrastructureRef:
43-
kind: AWSMachineTemplate
44-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
45-
name: "${CLUSTER_NAME}-control-plane"
4640
kubeadmConfigSpec:
47-
initConfiguration:
48-
nodeRegistration:
49-
name: $${COREOS_EC2_HOSTNAME}
50-
kubeletExtraArgs:
51-
cloud-provider: external
5241
clusterConfiguration:
5342
apiServer:
5443
extraArgs:
5544
cloud-provider: external
5645
controllerManager:
5746
extraArgs:
5847
cloud-provider: external
48+
initConfiguration:
49+
nodeRegistration:
50+
kubeletExtraArgs:
51+
cloud-provider: external
52+
name: $${COREOS_EC2_HOSTNAME}
5953
joinConfiguration:
6054
nodeRegistration:
6155
name: $${COREOS_EC2_HOSTNAME}
@@ -84,59 +78,65 @@ spec:
8478
preKubeadmCommands:
8579
- envsubst < /etc/kubeadm.yml > /etc/kubeadm.yml.tmp
8680
- mv /etc/kubeadm.yml.tmp /etc/kubeadm.yml
87-
version: ${KUBERNETES_VERSION}
81+
machineTemplate:
82+
infrastructureRef:
83+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
84+
kind: AWSMachineTemplate
85+
name: "${CLUSTER_NAME}-control-plane"
86+
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
87+
version: "${KUBERNETES_VERSION}"
8888
---
8989
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
9090
kind: AWSMachineTemplate
9191
metadata:
92-
name: ${CLUSTER_NAME}-control-plane
92+
name: "${CLUSTER_NAME}-control-plane"
9393
spec:
9494
template:
9595
spec:
96-
instanceType: ${AWS_CONTROL_PLANE_MACHINE_TYPE}
97-
iamInstanceProfile: control-plane.cluster-api-provider-aws.sigs.k8s.io
96+
iamInstanceProfile: "control-plane.cluster-api-provider-aws.sigs.k8s.io"
97+
instanceType: "${AWS_CONTROL_PLANE_MACHINE_TYPE}"
9898
imageLookupBaseOS: flatcar-stable
99-
sshKeyName: ${AWS_SSH_KEY_NAME}
99+
sshKeyName: "${AWS_SSH_KEY_NAME}"
100100
---
101101
apiVersion: cluster.x-k8s.io/v1beta1
102102
kind: MachineDeployment
103103
metadata:
104-
name: ${CLUSTER_NAME}-md-0
104+
name: "${CLUSTER_NAME}-md-0"
105105
spec:
106-
clusterName: ${CLUSTER_NAME}
106+
clusterName: "${CLUSTER_NAME}"
107107
replicas: ${WORKER_MACHINE_COUNT}
108108
selector:
109-
matchLabels:
109+
matchLabels: null
110110
template:
111111
spec:
112-
clusterName: ${CLUSTER_NAME}
113-
version: ${KUBERNETES_VERSION}
114112
bootstrap:
115113
configRef:
116114
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
117115
kind: KubeadmConfigTemplate
118-
name: ${CLUSTER_NAME}-md-0
116+
name: "${CLUSTER_NAME}-md-0"
117+
clusterName: ${CLUSTER_NAME}
119118
infrastructureRef:
120119
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
121120
kind: AWSMachineTemplate
122-
name: ${CLUSTER_NAME}-md-0
121+
name: "${CLUSTER_NAME}-md-0"
122+
version: ${KUBERNETES_VERSION}
123123
---
124124
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
125125
kind: AWSMachineTemplate
126126
metadata:
127-
name: ${CLUSTER_NAME}-md-0
127+
name: "${CLUSTER_NAME}-md-0"
128128
spec:
129129
template:
130130
spec:
131-
instanceType: ${AWS_NODE_MACHINE_TYPE}
132131
iamInstanceProfile: nodes.cluster-api-provider-aws.sigs.k8s.io
132+
instanceType: "${AWS_NODE_MACHINE_TYPE}"
133133
imageLookupBaseOS: flatcar-stable
134-
sshKeyName: ${AWS_SSH_KEY_NAME}
134+
sshKeyName: "${AWS_SSH_KEY_NAME}"
135135
---
136136
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
137137
kind: KubeadmConfigTemplate
138138
metadata:
139-
name: ${CLUSTER_NAME}-md-0
139+
name: "${CLUSTER_NAME}-md-0"
140140
spec:
141141
template:
142142
spec:
@@ -328,6 +328,13 @@ data:
328328
- list
329329
- update
330330
- watch
331+
- apiGroups:
332+
- ""
333+
resources:
334+
- configmaps
335+
verbs:
336+
- list
337+
- watch
331338
- apiGroups:
332339
- ""
333340
resources:
@@ -456,6 +463,27 @@ data:
456463
---
457464
apiVersion: rbac.authorization.k8s.io/v1
458465
kind: ClusterRole
466+
metadata:
467+
labels:
468+
app.kubernetes.io/name: aws-ebs-csi-driver
469+
name: ebs-csi-node
470+
rules:
471+
- apiGroups:
472+
- ""
473+
resources:
474+
- pods
475+
verbs:
476+
- get
477+
- patch
478+
- apiGroups:
479+
- ""
480+
resources:
481+
- nodes
482+
verbs:
483+
- get
484+
---
485+
apiVersion: rbac.authorization.k8s.io/v1
486+
kind: ClusterRole
459487
metadata:
460488
labels:
461489
app.kubernetes.io/name: aws-ebs-csi-driver
@@ -717,6 +745,21 @@ data:
717745
name: ebs-csi-controller-sa
718746
namespace: kube-system
719747
---
748+
apiVersion: rbac.authorization.k8s.io/v1
749+
kind: ClusterRoleBinding
750+
metadata:
751+
labels:
752+
app.kubernetes.io/name: aws-ebs-csi-driver
753+
name: ebs-csi-node-binding
754+
roleRef:
755+
apiGroup: rbac.authorization.k8s.io
756+
kind: ClusterRole
757+
name: ebs-csi-node
758+
subjects:
759+
- kind: ServiceAccount
760+
name: ebs-csi-node-sa
761+
namespace: kube-system
762+
---
720763
apiVersion: apps/v1
721764
kind: Deployment
722765
metadata:

0 commit comments

Comments
 (0)