Skip to content

Commit b8fa601

Browse files
author
Huy Mai
committed
Use kustomize new syntax for patches
1 parent 4bba410 commit b8fa601

File tree

11 files changed

+131
-120
lines changed

11 files changed

+131
-120
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
resources:
22
- cluster-template.yaml
3+
apiVersion: kustomize.config.k8s.io/v1beta1
4+
kind: Kustomization
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
resources:
22
- ../default
33

4-
patchesStrategicMerge:
5-
- patch-flatcar.yaml
4+
apiVersion: kustomize.config.k8s.io/v1beta1
5+
kind: Kustomization
6+
patches:
7+
- path: patch-oc.yaml
8+
- path: patch-kcp.yaml
9+
- path: patch-kcpt.yaml
10+
- path: patch-omt-cp.yaml
11+
- path: patch-omt-md.yaml

kustomize/v1alpha7/flatcar/patch-flatcar.yaml

Lines changed: 0 additions & 109 deletions
This file was deleted.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
3+
kind: KubeadmControlPlane
4+
metadata:
5+
name: "${CLUSTER_NAME}-control-plane"
6+
spec:
7+
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
8+
kubeadmConfigSpec:
9+
joinConfiguration:
10+
nodeRegistration:
11+
name: $${COREOS_OPENSTACK_HOSTNAME}
12+
kubeletExtraArgs:
13+
provider-id: null
14+
initConfiguration:
15+
nodeRegistration:
16+
name: $${COREOS_OPENSTACK_HOSTNAME}
17+
kubeletExtraArgs:
18+
# Fixme(lentzi90): This is here just to override the value set in the default
19+
# kustomization. It will be replaced with a value that works for flatcar in
20+
# https://github.com/kubernetes-sigs/cluster-api-provider-openstack/pull/1564
21+
provider-id: null
22+
format: ignition
23+
ignition:
24+
containerLinuxConfig:
25+
additionalConfig: |
26+
systemd:
27+
units:
28+
29+
enabled: true
30+
- name: kubeadm.service
31+
enabled: true
32+
dropins:
33+
- name: 10-flatcar.conf
34+
contents: |
35+
[Unit]
36+
Requires=containerd.service coreos-metadata.service
37+
After=containerd.service coreos-metadata.service
38+
39+
[Service]
40+
EnvironmentFile=/run/metadata/flatcar
41+
preKubeadmCommands:
42+
- export COREOS_OPENSTACK_HOSTNAME=$${COREOS_OPENSTACK_HOSTNAME%.*}
43+
- envsubst < /etc/kubeadm.yml > /etc/kubeadm.yml.tmp
44+
- mv /etc/kubeadm.yml.tmp /etc/kubeadm.yml
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
3+
kind: KubeadmConfigTemplate
4+
metadata:
5+
name: ${CLUSTER_NAME}-md-0
6+
spec:
7+
template:
8+
spec:
9+
joinConfiguration:
10+
nodeRegistration:
11+
name: $${COREOS_OPENSTACK_HOSTNAME}
12+
kubeletExtraArgs:
13+
# Fixme(lentzi90): This is here just to override the value set in the default
14+
# kustomization. It will be replaced with a value that works for flatcar in
15+
# https://github.com/kubernetes-sigs/cluster-api-provider-openstack/pull/1564
16+
provider-id: null
17+
preKubeadmCommands:
18+
- export COREOS_OPENSTACK_HOSTNAME=$${COREOS_OPENSTACK_HOSTNAME%.*}
19+
- envsubst < /etc/kubeadm.yml > /etc/kubeadm.yml.tmp
20+
- mv /etc/kubeadm.yml.tmp /etc/kubeadm.yml
21+
format: ignition
22+
ignition:
23+
containerLinuxConfig:
24+
additionalConfig: |
25+
systemd:
26+
units:
27+
28+
enabled: true
29+
- name: kubeadm.service
30+
enabled: true
31+
dropins:
32+
- name: 10-flatcar.conf
33+
contents: |
34+
[Unit]
35+
Requires=containerd.service coreos-metadata.service
36+
After=containerd.service coreos-metadata.service
37+
38+
[Service]
39+
EnvironmentFile=/run/metadata/flatcar

kustomize/v1alpha7/without-lb/patch-without-lb.yaml renamed to kustomize/v1alpha7/flatcar/patch-oc.yaml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,3 @@ metadata:
66
spec:
77
apiServerLoadBalancer:
88
$patch: delete
9-
---
10-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
11-
kind: KubeadmControlPlane
12-
metadata:
13-
name: "${CLUSTER_NAME}-control-plane"
14-
spec:
15-
replicas: 1
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/v1alpha7
3+
kind: OpenStackMachineTemplate
4+
metadata:
5+
name: ${CLUSTER_NAME}-md-0
6+
spec:
7+
template:
8+
spec:
9+
image: ${OPENSTACK_FLATCAR_IMAGE_NAME}
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/v1alpha7
3+
kind: OpenStackMachineTemplate
4+
metadata:
5+
name: ${CLUSTER_NAME}-control-plane
6+
spec:
7+
template:
8+
spec:
9+
image: ${OPENSTACK_FLATCAR_IMAGE_NAME}
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
resources:
22
- ../default
33

4-
patchesStrategicMerge:
5-
- patch-without-lb.yaml
4+
apiVersion: kustomize.config.k8s.io/v1beta1
5+
kind: Kustomization
6+
patches:
7+
- path: patch-oc.yaml
8+
- path: patch-kcp.yaml
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
3+
kind: KubeadmControlPlane
4+
metadata:
5+
name: "${CLUSTER_NAME}-control-plane"
6+
spec:
7+
replicas: 1

0 commit comments

Comments
 (0)