|
| 1 | +--- |
| 2 | +apiVersion: cluster.x-k8s.io/v1beta1 |
| 3 | +kind: Cluster |
| 4 | +metadata: |
| 5 | + name: "${CLUSTER_NAME}" |
| 6 | + labels: |
| 7 | + cni: "${CLUSTER_NAME}-crs-cni" |
| 8 | +spec: |
| 9 | + clusterNetwork: |
| 10 | + pods: |
| 11 | + cidrBlocks: ["192.168.0.0/16"] |
| 12 | + infrastructureRef: |
| 13 | + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 |
| 14 | + kind: GCPCluster |
| 15 | + name: "${CLUSTER_NAME}" |
| 16 | + controlPlaneRef: |
| 17 | + kind: KubeadmControlPlane |
| 18 | + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 |
| 19 | + name: "${CLUSTER_NAME}-control-plane" |
| 20 | +--- |
| 21 | +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 |
| 22 | +kind: GCPCluster |
| 23 | +metadata: |
| 24 | + name: "${CLUSTER_NAME}" |
| 25 | +spec: |
| 26 | + project: "${GCP_PROJECT}" |
| 27 | + region: "${GCP_REGION}" |
| 28 | + network: |
| 29 | + name: "${GCP_NETWORK_NAME}" |
| 30 | +--- |
| 31 | +kind: KubeadmControlPlane |
| 32 | +apiVersion: controlplane.cluster.x-k8s.io/v1beta1 |
| 33 | +metadata: |
| 34 | + name: "${CLUSTER_NAME}-control-plane" |
| 35 | +spec: |
| 36 | + replicas: ${CONTROL_PLANE_MACHINE_COUNT} |
| 37 | + machineTemplate: |
| 38 | + infrastructureRef: |
| 39 | + kind: GCPMachineTemplate |
| 40 | + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 |
| 41 | + name: "${CLUSTER_NAME}-control-plane" |
| 42 | + kubeadmConfigSpec: |
| 43 | + files: [] |
| 44 | + format: ignition |
| 45 | + ignition: |
| 46 | + containerLinuxConfig: |
| 47 | + additionalConfig: | |
| 48 | + storage: |
| 49 | + links: |
| 50 | + - path: /etc/extensions/kubernetes.raw |
| 51 | + hard: false |
| 52 | + target: /opt/extensions/kubernetes/kubernetes-${KUBERNETES_VERSION}-x86-64.raw |
| 53 | + files: |
| 54 | + - path: /etc/sysupdate.kubernetes.d/kubernetes-${KUBERNETES_VERSION%.*}.conf |
| 55 | + mode: 0644 |
| 56 | + contents: |
| 57 | + remote: |
| 58 | + url: https://github.com/flatcar/sysext-bakery/releases/download/latest/kubernetes-${KUBERNETES_VERSION%.*}.conf |
| 59 | + - path: /etc/sysupdate.d/noop.conf |
| 60 | + mode: 0644 |
| 61 | + contents: |
| 62 | + remote: |
| 63 | + url: https://github.com/flatcar/sysext-bakery/releases/download/latest/noop.conf |
| 64 | + - path: /opt/extensions/kubernetes/kubernetes-${KUBERNETES_VERSION}-x86-64.raw |
| 65 | + contents: |
| 66 | + remote: |
| 67 | + url: https://github.com/flatcar/sysext-bakery/releases/download/latest/kubernetes-${KUBERNETES_VERSION}-x86-64.raw |
| 68 | + systemd: |
| 69 | + units: |
| 70 | + - name: systemd-sysupdate.service |
| 71 | + dropins: |
| 72 | + - name: kubernetes.conf |
| 73 | + contents: | |
| 74 | + [Service] |
| 75 | + ExecStartPre=/usr/bin/sh -c "readlink --canonicalize /etc/extensions/kubernetes.raw > /tmp/kubernetes" |
| 76 | + ExecStartPre=/usr/lib/systemd/systemd-sysupdate -C kubernetes update |
| 77 | + ExecStartPost=/usr/bin/sh -c "readlink --canonicalize /etc/extensions/kubernetes.raw > /tmp/kubernetes-new" |
| 78 | + ExecStartPost=/usr/bin/sh -c "if ! cmp --silent /tmp/kubernetes /tmp/kubernetes-new; then touch /run/reboot-required; fi" |
| 79 | + - name: update-engine.service |
| 80 | + # Set this to 'false' if you want to enable Flatcar auto-update |
| 81 | + mask: ${FLATCAR_DISABLE_AUTO_UPDATE:=true} |
| 82 | + - name: locksmithd.service |
| 83 | + # NOTE: To coordinate the node reboot in this context, we recommend to use Kured. |
| 84 | + mask: true |
| 85 | + - name: systemd-sysupdate.timer |
| 86 | + # Set this to 'true' if you want to enable the Kubernetes auto-update. |
| 87 | + # NOTE: Only patches version will be pulled. |
| 88 | + enabled: ${FLATCAR_DISABLE_AUTO_UPDATE:=true} |
| 89 | + |
| 90 | + enabled: true |
| 91 | + - name: kubeadm.service |
| 92 | + enabled: true |
| 93 | + dropins: |
| 94 | + - name: 10-flatcar.conf |
| 95 | + contents: | |
| 96 | + [Unit] |
| 97 | + Requires=containerd.service coreos-metadata.service |
| 98 | + After=containerd.service coreos-metadata.service |
| 99 | + [Service] |
| 100 | + EnvironmentFile=/run/metadata/flatcar |
| 101 | + initConfiguration: |
| 102 | + nodeRegistration: |
| 103 | + name: $${COREOS_GCE_HOSTNAME} |
| 104 | + kubeletExtraArgs: |
| 105 | + cloud-provider: gce |
| 106 | + feature-gates: "DisableCloudProviders=false,DisableKubeletCloudCredentialProviders=false" |
| 107 | + clusterConfiguration: |
| 108 | + apiServer: |
| 109 | + timeoutForControlPlane: 20m |
| 110 | + extraArgs: |
| 111 | + cloud-provider: gce |
| 112 | + feature-gates: "DisableCloudProviders=false,DisableKubeletCloudCredentialProviders=false" |
| 113 | + controllerManager: |
| 114 | + extraArgs: |
| 115 | + cloud-provider: gce |
| 116 | + feature-gates: "DisableCloudProviders=false,DisableKubeletCloudCredentialProviders=false" |
| 117 | + allocate-node-cidrs: "false" |
| 118 | + joinConfiguration: |
| 119 | + nodeRegistration: |
| 120 | + name: $${COREOS_GCE_HOSTNAME} |
| 121 | + kubeletExtraArgs: |
| 122 | + cloud-provider: gce |
| 123 | + feature-gates: "DisableCloudProviders=false,DisableKubeletCloudCredentialProviders=false" |
| 124 | + preKubeadmCommands: |
| 125 | + - export COREOS_GCE_HOSTNAME=$${COREOS_GCE_HOSTNAME%%.*} |
| 126 | + - envsubst < /etc/kubeadm.yml > /etc/kubeadm.yml.tmp |
| 127 | + - mv /etc/kubeadm.yml.tmp /etc/kubeadm.yml |
| 128 | + version: "${KUBERNETES_VERSION}" |
| 129 | +--- |
| 130 | +kind: GCPMachineTemplate |
| 131 | +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 |
| 132 | +metadata: |
| 133 | + name: "${CLUSTER_NAME}-control-plane" |
| 134 | +spec: |
| 135 | + template: |
| 136 | + spec: |
| 137 | + instanceType: "${GCP_CONTROL_PLANE_MACHINE_TYPE}" |
| 138 | + image: "${IMAGE_ID}" |
| 139 | +--- |
| 140 | +apiVersion: cluster.x-k8s.io/v1beta1 |
| 141 | +kind: MachineDeployment |
| 142 | +metadata: |
| 143 | + name: "${CLUSTER_NAME}-md-0" |
| 144 | +spec: |
| 145 | + clusterName: "${CLUSTER_NAME}" |
| 146 | + replicas: ${WORKER_MACHINE_COUNT} |
| 147 | + selector: |
| 148 | + matchLabels: |
| 149 | + template: |
| 150 | + spec: |
| 151 | + clusterName: "${CLUSTER_NAME}" |
| 152 | + version: "${KUBERNETES_VERSION}" |
| 153 | + bootstrap: |
| 154 | + configRef: |
| 155 | + name: "${CLUSTER_NAME}-md-0" |
| 156 | + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 |
| 157 | + kind: KubeadmConfigTemplate |
| 158 | + infrastructureRef: |
| 159 | + name: "${CLUSTER_NAME}-md-0" |
| 160 | + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 |
| 161 | + kind: GCPMachineTemplate |
| 162 | +--- |
| 163 | +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 |
| 164 | +kind: GCPMachineTemplate |
| 165 | +metadata: |
| 166 | + name: "${CLUSTER_NAME}-md-0" |
| 167 | +spec: |
| 168 | + template: |
| 169 | + spec: |
| 170 | + instanceType: "${GCP_NODE_MACHINE_TYPE}" |
| 171 | + image: "${IMAGE_ID}" |
| 172 | +--- |
| 173 | +apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 |
| 174 | +kind: KubeadmConfigTemplate |
| 175 | +metadata: |
| 176 | + name: "${CLUSTER_NAME}-md-0" |
| 177 | +spec: |
| 178 | + template: |
| 179 | + spec: |
| 180 | + files: [] |
| 181 | + format: ignition |
| 182 | + ignition: |
| 183 | + containerLinuxConfig: |
| 184 | + additionalConfig: | |
| 185 | + storage: |
| 186 | + links: |
| 187 | + - path: /etc/extensions/kubernetes.raw |
| 188 | + hard: false |
| 189 | + target: /opt/extensions/kubernetes/kubernetes-${KUBERNETES_VERSION}-x86-64.raw |
| 190 | + files: |
| 191 | + - path: /etc/sysupdate.kubernetes.d/kubernetes-${KUBERNETES_VERSION%.*}.conf |
| 192 | + mode: 0644 |
| 193 | + contents: |
| 194 | + remote: |
| 195 | + url: https://github.com/flatcar/sysext-bakery/releases/download/latest/kubernetes-${KUBERNETES_VERSION%.*}.conf |
| 196 | + - path: /etc/sysupdate.d/noop.conf |
| 197 | + mode: 0644 |
| 198 | + contents: |
| 199 | + remote: |
| 200 | + url: https://github.com/flatcar/sysext-bakery/releases/download/latest/noop.conf |
| 201 | + - path: /opt/extensions/kubernetes/kubernetes-${KUBERNETES_VERSION}-x86-64.raw |
| 202 | + contents: |
| 203 | + remote: |
| 204 | + url: https://github.com/flatcar/sysext-bakery/releases/download/latest/kubernetes-${KUBERNETES_VERSION}-x86-64.raw |
| 205 | + systemd: |
| 206 | + units: |
| 207 | + - name: systemd-sysupdate.service |
| 208 | + dropins: |
| 209 | + - name: kubernetes.conf |
| 210 | + contents: | |
| 211 | + [Service] |
| 212 | + ExecStartPre=/usr/bin/sh -c "readlink --canonicalize /etc/extensions/kubernetes.raw > /tmp/kubernetes" |
| 213 | + ExecStartPre=/usr/lib/systemd/systemd-sysupdate -C kubernetes update |
| 214 | + ExecStartPost=/usr/bin/sh -c "readlink --canonicalize /etc/extensions/kubernetes.raw > /tmp/kubernetes-new" |
| 215 | + ExecStartPost=/usr/bin/sh -c "if ! cmp --silent /tmp/kubernetes /tmp/kubernetes-new; then touch /run/reboot-required; fi" |
| 216 | + - name: update-engine.service |
| 217 | + # Set this to 'false' if you want to enable Flatcar auto-update |
| 218 | + mask: ${FLATCAR_DISABLE_AUTO_UPDATE:=true} |
| 219 | + - name: locksmithd.service |
| 220 | + # NOTE: To coordinate the node reboot in this context, we recommend to use Kured. |
| 221 | + mask: true |
| 222 | + - name: systemd-sysupdate.timer |
| 223 | + # Set this to 'true' if you want to enable the Kubernetes auto-update. |
| 224 | + # NOTE: Only patches version will be pulled. |
| 225 | + enabled: ${FLATCAR_DISABLE_AUTO_UPDATE:=true} |
| 226 | + |
| 227 | + enabled: true |
| 228 | + - name: kubeadm.service |
| 229 | + enabled: true |
| 230 | + dropins: |
| 231 | + - name: 10-flatcar.conf |
| 232 | + contents: | |
| 233 | + [Unit] |
| 234 | + Requires=containerd.service coreos-metadata.service |
| 235 | + After=containerd.service coreos-metadata.service |
| 236 | + [Service] |
| 237 | + EnvironmentFile=/run/metadata/flatcar |
| 238 | + joinConfiguration: |
| 239 | + nodeRegistration: |
| 240 | + name: $${COREOS_GCE_HOSTNAME} |
| 241 | + kubeletExtraArgs: |
| 242 | + cloud-provider: gce |
| 243 | + feature-gates: "DisableCloudProviders=false,DisableKubeletCloudCredentialProviders=false" |
| 244 | + preKubeadmCommands: |
| 245 | + - export COREOS_GCE_HOSTNAME=$${COREOS_GCE_HOSTNAME%%.*} |
| 246 | + - envsubst < /etc/kubeadm.yml > /etc/kubeadm.yml.tmp |
| 247 | + - mv /etc/kubeadm.yml.tmp /etc/kubeadm.yml |
| 248 | +--- |
| 249 | +apiVersion: v1 |
| 250 | +kind: ConfigMap |
| 251 | +metadata: |
| 252 | + name: "${CLUSTER_NAME}-crs-cni" |
| 253 | +data: ${CNI_RESOURCES} |
| 254 | +--- |
| 255 | +apiVersion: addons.cluster.x-k8s.io/v1beta1 |
| 256 | +kind: ClusterResourceSet |
| 257 | +metadata: |
| 258 | + name: "${CLUSTER_NAME}-crs-cni" |
| 259 | +spec: |
| 260 | + strategy: ApplyOnce |
| 261 | + clusterSelector: |
| 262 | + matchLabels: |
| 263 | + cni: "${CLUSTER_NAME}-crs-cni" |
| 264 | + resources: |
| 265 | + - name: "${CLUSTER_NAME}-crs-cni" |
| 266 | + kind: ConfigMap |
0 commit comments