|
| 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} |
0 commit comments