Skip to content

Commit 173f41b

Browse files
committed
Move flatcar-sysext to v1alpha8
This was added via v1alpha7 but the latest api is v1alpha8 and to keep our CI consistent we will move the manifests to v1alpha8.
1 parent 7edf6a1 commit 173f41b

File tree

4 files changed

+199
-7
lines changed

4 files changed

+199
-7
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
resources:
4+
- ../default
5+
6+
patches:
7+
- path: patch-flatcar.yaml
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
---
2+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha8
3+
kind: OpenStackCluster
4+
metadata:
5+
name: ${CLUSTER_NAME}
6+
spec:
7+
apiServerLoadBalancer:
8+
$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: ${CONTROL_PLANE_MACHINE_COUNT}
16+
kubeadmConfigSpec:
17+
joinConfiguration:
18+
nodeRegistration:
19+
name: $${COREOS_OPENSTACK_HOSTNAME}
20+
kubeletExtraArgs:
21+
provider-id: null
22+
initConfiguration:
23+
nodeRegistration:
24+
name: $${COREOS_OPENSTACK_HOSTNAME}
25+
kubeletExtraArgs:
26+
# Fixme(lentzi90): This is here just to override the value set in the default
27+
# kustomization. It will be replaced with a value that works for flatcar in
28+
# https://github.com/kubernetes-sigs/cluster-api-provider-openstack/pull/1564
29+
provider-id: null
30+
format: ignition
31+
ignition:
32+
containerLinuxConfig:
33+
additionalConfig: |
34+
storage:
35+
links:
36+
- path: /etc/extensions/kubernetes.raw
37+
hard: false
38+
target: /opt/extensions/kubernetes/kubernetes-${KUBERNETES_VERSION}-x86-64.raw
39+
files:
40+
- path: /etc/sysupdate.kubernetes.d/kubernetes-${KUBERNETES_VERSION%.*}.conf
41+
mode: 0644
42+
contents:
43+
remote:
44+
url: https://github.com/flatcar/sysext-bakery/releases/download/latest/kubernetes-${KUBERNETES_VERSION%.*}.conf
45+
- path: /etc/sysupdate.d/noop.conf
46+
mode: 0644
47+
contents:
48+
remote:
49+
url: https://github.com/flatcar/sysext-bakery/releases/download/latest/noop.conf
50+
- path: /opt/extensions/kubernetes/kubernetes-${KUBERNETES_VERSION}-x86-64.raw
51+
contents:
52+
remote:
53+
url: https://github.com/flatcar/sysext-bakery/releases/download/latest/kubernetes-${KUBERNETES_VERSION}-x86-64.raw
54+
systemd:
55+
units:
56+
- name: systemd-sysupdate.service
57+
dropins:
58+
- name: kubernetes.conf
59+
contents: |
60+
[Service]
61+
ExecStartPre=/usr/bin/sh -c "readlink --canonicalize /etc/extensions/kubernetes.raw > /tmp/kubernetes"
62+
ExecStartPre=/usr/lib/systemd/systemd-sysupdate -C kubernetes update
63+
ExecStartPost=/usr/bin/sh -c "readlink --canonicalize /etc/extensions/kubernetes.raw > /tmp/kubernetes-new"
64+
ExecStartPost=/usr/bin/sh -c "if ! cmp --silent /tmp/kubernetes /tmp/kubernetes-new; then touch /run/reboot-required; fi"
65+
- name: update-engine.service
66+
# Set this to 'false' if you want to enable Flatcar auto-update
67+
mask: ${FLATCAR_DISABLE_AUTO_UPDATE:=true}
68+
- name: locksmithd.service
69+
# NOTE: To coordinate the node reboot in this context, we recommend to use Kured.
70+
mask: true
71+
- name: systemd-sysupdate.timer
72+
# Set this to 'true' if you want to enable the Kubernetes auto-update.
73+
# NOTE: Only patches version will be pulled.
74+
enabled: false
75+
76+
enabled: true
77+
- name: kubeadm.service
78+
enabled: true
79+
dropins:
80+
- name: 10-flatcar.conf
81+
contents: |
82+
[Unit]
83+
Requires=containerd.service coreos-metadata.service
84+
After=containerd.service coreos-metadata.service
85+
[Service]
86+
EnvironmentFile=/run/metadata/flatcar
87+
preKubeadmCommands:
88+
- export COREOS_OPENSTACK_HOSTNAME=$${COREOS_OPENSTACK_HOSTNAME%.*}
89+
- envsubst < /etc/kubeadm.yml > /etc/kubeadm.yml.tmp
90+
- mv /etc/kubeadm.yml.tmp /etc/kubeadm.yml
91+
---
92+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
93+
kind: KubeadmConfigTemplate
94+
metadata:
95+
name: ${CLUSTER_NAME}-md-0
96+
spec:
97+
template:
98+
spec:
99+
joinConfiguration:
100+
nodeRegistration:
101+
name: $${COREOS_OPENSTACK_HOSTNAME}
102+
kubeletExtraArgs:
103+
# Fixme(lentzi90): This is here just to override the value set in the default
104+
# kustomization. It will be replaced with a value that works for flatcar in
105+
# https://github.com/kubernetes-sigs/cluster-api-provider-openstack/pull/1564
106+
provider-id: null
107+
preKubeadmCommands:
108+
- export COREOS_OPENSTACK_HOSTNAME=$${COREOS_OPENSTACK_HOSTNAME%.*}
109+
- envsubst < /etc/kubeadm.yml > /etc/kubeadm.yml.tmp
110+
- mv /etc/kubeadm.yml.tmp /etc/kubeadm.yml
111+
format: ignition
112+
ignition:
113+
containerLinuxConfig:
114+
additionalConfig: |
115+
storage:
116+
links:
117+
- path: /etc/extensions/kubernetes.raw
118+
hard: false
119+
target: /opt/extensions/kubernetes/kubernetes-${KUBERNETES_VERSION}-x86-64.raw
120+
files:
121+
- path: /etc/sysupdate.kubernetes.d/kubernetes-${KUBERNETES_VERSION%.*}.conf
122+
mode: 0644
123+
contents:
124+
remote:
125+
url: https://github.com/flatcar/sysext-bakery/releases/download/latest/kubernetes-${KUBERNETES_VERSION%.*}.conf
126+
- path: /etc/sysupdate.d/noop.conf
127+
mode: 0644
128+
contents:
129+
remote:
130+
url: https://github.com/flatcar/sysext-bakery/releases/download/latest/noop.conf
131+
- path: /opt/extensions/kubernetes/kubernetes-${KUBERNETES_VERSION}-x86-64.raw
132+
contents:
133+
remote:
134+
url: https://github.com/flatcar/sysext-bakery/releases/download/latest/kubernetes-${KUBERNETES_VERSION}-x86-64.raw
135+
systemd:
136+
units:
137+
- name: systemd-sysupdate.service
138+
dropins:
139+
- name: kubernetes.conf
140+
contents: |
141+
[Service]
142+
ExecStartPre=/usr/bin/sh -c "readlink --canonicalize /etc/extensions/kubernetes.raw > /tmp/kubernetes"
143+
ExecStartPre=/usr/lib/systemd/systemd-sysupdate -C kubernetes update
144+
ExecStartPost=/usr/bin/sh -c "readlink --canonicalize /etc/extensions/kubernetes.raw > /tmp/kubernetes-new"
145+
ExecStartPost=/usr/bin/sh -c "if ! cmp --silent /tmp/kubernetes /tmp/kubernetes-new; then touch /run/reboot-required; fi"
146+
- name: update-engine.service
147+
# Set this to 'false' if you want to enable Flatcar auto-update
148+
mask: ${FLATCAR_DISABLE_AUTO_UPDATE:=true}
149+
- name: locksmithd.service
150+
# NOTE: To coordinate the node reboot in this context, we recommend to use Kured.
151+
mask: true
152+
- name: systemd-sysupdate.timer
153+
# Set this to 'true' if you want to enable the Kubernetes auto-update.
154+
# NOTE: Only patches version will be pulled.
155+
enabled: false
156+
157+
enabled: true
158+
- name: kubeadm.service
159+
enabled: true
160+
dropins:
161+
- name: 10-flatcar.conf
162+
contents: |
163+
[Unit]
164+
Requires=containerd.service coreos-metadata.service
165+
After=containerd.service coreos-metadata.service
166+
[Service]
167+
EnvironmentFile=/run/metadata/flatcar
168+
---
169+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha8
170+
kind: OpenStackMachineTemplate
171+
metadata:
172+
name: ${CLUSTER_NAME}-md-0
173+
spec:
174+
template:
175+
spec:
176+
image: ${FLATCAR_IMAGE_NAME}
177+
---
178+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha8
179+
kind: OpenStackMachineTemplate
180+
metadata:
181+
name: ${CLUSTER_NAME}-control-plane
182+
spec:
183+
template:
184+
spec:
185+
image: ${FLATCAR_IMAGE_NAME}

templates/cluster-template-flatcar-sysext.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ spec:
9898
kind: KubeadmControlPlane
9999
name: ${CLUSTER_NAME}-control-plane
100100
infrastructureRef:
101-
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7
101+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha8
102102
kind: OpenStackCluster
103103
name: ${CLUSTER_NAME}
104104
---
@@ -121,7 +121,7 @@ spec:
121121
clusterName: ${CLUSTER_NAME}
122122
failureDomain: ${OPENSTACK_FAILURE_DOMAIN}
123123
infrastructureRef:
124-
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7
124+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha8
125125
kind: OpenStackMachineTemplate
126126
name: ${CLUSTER_NAME}-md-0
127127
version: ${KUBERNETES_VERSION}
@@ -213,13 +213,13 @@ spec:
213213
- mv /etc/kubeadm.yml.tmp /etc/kubeadm.yml
214214
machineTemplate:
215215
infrastructureRef:
216-
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7
216+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha8
217217
kind: OpenStackMachineTemplate
218218
name: ${CLUSTER_NAME}-control-plane
219219
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
220220
version: ${KUBERNETES_VERSION}
221221
---
222-
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7
222+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha8
223223
kind: OpenStackCluster
224224
metadata:
225225
name: ${CLUSTER_NAME}
@@ -234,7 +234,7 @@ spec:
234234
managedSecurityGroups: true
235235
nodeCidr: 10.6.0.0/24
236236
---
237-
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7
237+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha8
238238
kind: OpenStackMachineTemplate
239239
metadata:
240240
name: ${CLUSTER_NAME}-control-plane
@@ -249,7 +249,7 @@ spec:
249249
image: ${FLATCAR_IMAGE_NAME}
250250
sshKeyName: ${OPENSTACK_SSH_KEY_NAME}
251251
---
252-
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha7
252+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha8
253253
kind: OpenStackMachineTemplate
254254
metadata:
255255
name: ${CLUSTER_NAME}-md-0

test/e2e/data/kustomize/flatcar-sysext/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
resources:
3-
- ../../../../../kustomize/v1alpha7/flatcar-sysext
3+
- ../../../../../kustomize/v1alpha8/flatcar-sysext
44

55
components:
66
- ../common-patches/cni

0 commit comments

Comments
 (0)