Skip to content

Commit ca72308

Browse files
[feat] added placementGroup to full flavors (#499)
* - created placement group addons * - patched full flavors with placementGroup addons * - updated environment variable `REGION` to `LINODE_REGION` * - changed the kind from `LinodePlacementGroups` to `LinodeMachineTemplate` in the patches * added credentialsRef to kustomization.yaml in the placementGroup addons Co-authored-by: Evan <ejohnson@akamai.com> * - updated target to change only the control-plane on LinodeMachineTemplate --------- Co-authored-by: Evan <ejohnson@akamai.com>
1 parent 3a88aed commit ca72308

File tree

8 files changed

+121
-1
lines changed

8 files changed

+121
-1
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- linodePlacementGroup.yaml
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
3+
kind: LinodePlacementGroup
4+
metadata:
5+
name: ${CLUSTER_NAME}
6+
spec:
7+
credentialsRef:
8+
name: ${CLUSTER_NAME}-credentials
9+
region: ${LINODE_REGION}

templates/flavors/k3s/full-vpcless/kustomization.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ resources:
66
- ../../../addons/cluster-autoscaler
77
- ../../../addons/etcd-backup-restore
88
- ../../../addons/machine-health-check
9+
- ../../../addons/placementGroups
910

1011
patches:
1112
- target:
@@ -178,3 +179,20 @@ patches:
178179
patch: |-
179180
- op: remove
180181
path: /spec/template/spec/firewallRef
182+
- target:
183+
group: infrastructure.cluster.x-k8s.io
184+
version: v1alpha2
185+
kind: LinodeMachineTemplate
186+
name: .*-control-plane
187+
patch: |-
188+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
189+
kind: LinodeMachineTemplate
190+
metadata:
191+
name: ${CLUSTER_NAME}-control-plane
192+
spec:
193+
template:
194+
spec:
195+
placementGroupRef:
196+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
197+
kind: LinodePlacementGroup
198+
name: ${CLUSTER_NAME}

templates/flavors/k3s/full/kustomization.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ resources:
66
- ../../../addons/cluster-autoscaler
77
- ../../../addons/etcd-backup-restore
88
- ../../../addons/machine-health-check
9+
- ../../../addons/placementGroups
910

1011
patches:
1112
- target:
@@ -32,3 +33,20 @@ patches:
3233
labels:
3334
cluster-autoscaler: "true"
3435
etcd-backup: "true"
36+
- target:
37+
group: infrastructure.cluster.x-k8s.io
38+
version: v1alpha2
39+
kind: LinodeMachineTemplate
40+
name: .*-control-plane
41+
patch: |-
42+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
43+
kind: LinodeMachineTemplate
44+
metadata:
45+
name: ${CLUSTER_NAME}-control-plane
46+
spec:
47+
template:
48+
spec:
49+
placementGroupRef:
50+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
51+
kind: LinodePlacementGroup
52+
name: ${CLUSTER_NAME}

templates/flavors/kubeadm/full-vpcless/kustomization.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ resources:
66
- ../../../addons/cluster-autoscaler
77
- ../../../addons/etcd-backup-restore
88
- ../../../addons/machine-health-check
9-
9+
- ../../../addons/placementGroups
1010

1111
patches:
1212
- target:
@@ -205,3 +205,20 @@ patches:
205205
patch: |-
206206
- op: remove
207207
path: /spec/template/spec/firewallRef
208+
- target:
209+
group: infrastructure.cluster.x-k8s.io
210+
version: v1alpha2
211+
kind: LinodeMachineTemplate
212+
name: .*-control-plane
213+
patch: |-
214+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
215+
kind: LinodeMachineTemplate
216+
metadata:
217+
name: ${CLUSTER_NAME}-control-plane
218+
spec:
219+
template:
220+
spec:
221+
placementGroupRef:
222+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
223+
kind: LinodePlacementGroup
224+
name: ${CLUSTER_NAME}

templates/flavors/kubeadm/full/kustomization.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ resources:
66
- ../../../addons/cluster-autoscaler
77
- ../../../addons/etcd-backup-restore
88
- ../../../addons/machine-health-check
9+
- ../../../addons/placementGroups
910

1011
patches:
1112
- target:
@@ -85,3 +86,20 @@ patches:
8586
maxRetry: 5
8687
retryPeriod: 2m
8788
minHealthyPeriod: 2h
89+
- target:
90+
group: infrastructure.cluster.x-k8s.io
91+
version: v1alpha2
92+
kind: LinodeMachineTemplate
93+
name: .*-control-plane
94+
patch: |-
95+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
96+
kind: LinodeMachineTemplate
97+
metadata:
98+
name: ${CLUSTER_NAME}-control-plane
99+
spec:
100+
template:
101+
spec:
102+
placementGroupRef:
103+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
104+
kind: LinodePlacementGroup
105+
name: ${CLUSTER_NAME}

templates/flavors/rke2/full-vpcless/kustomization.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ resources:
66
- ../../../addons/cluster-autoscaler
77
- ../../../addons/etcd-backup-restore
88
- ../../../addons/machine-health-check
9+
- ../../../addons/placementGroups
910

1011
patches:
1112
- target:
@@ -79,3 +80,20 @@ patches:
7980
kind: LinodeFirewall
8081
metadata:
8182
name: ${CLUSTER_NAME}
83+
- target:
84+
group: infrastructure.cluster.x-k8s.io
85+
version: v1alpha2
86+
kind: LinodeMachineTemplate
87+
name: .*-control-plane
88+
patch: |-
89+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
90+
kind: LinodeMachineTemplate
91+
metadata:
92+
name: ${CLUSTER_NAME}-control-plane
93+
spec:
94+
template:
95+
spec:
96+
placementGroupRef:
97+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
98+
kind: LinodePlacementGroup
99+
name: ${CLUSTER_NAME}

templates/flavors/rke2/full/kustomization.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ resources:
66
- ../../../addons/cluster-autoscaler
77
- ../../../addons/etcd-backup-restore
88
- ../../../addons/machine-health-check
9+
- ../../../addons/placementGroups
910

1011
patches:
1112
- target:
@@ -71,3 +72,20 @@ patches:
7172
device: /dev/sdc
7273
mounts:
7374
- ["/dev/sdc", "/var/lib/etcd_data"]
75+
- target:
76+
group: infrastructure.cluster.x-k8s.io
77+
version: v1alpha2
78+
kind: LinodeMachineTemplate
79+
name: .*-control-plane
80+
patch: |-
81+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
82+
kind: LinodeMachineTemplate
83+
metadata:
84+
name: ${CLUSTER_NAME}-control-plane
85+
spec:
86+
template:
87+
spec:
88+
placementGroupRef:
89+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha2
90+
kind: LinodePlacementGroup
91+
name: ${CLUSTER_NAME}

0 commit comments

Comments
 (0)