-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modifications to get flatcar working
* Move flatcar config spec into specialised define block * generic osDistro variable to specify "flatcar" and future other OS
- Loading branch information
Travis Holton
committed
Oct 25, 2023
1 parent
023a8f0
commit 2238a43
Showing
5 changed files
with
68 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -203,13 +203,15 @@ files: | |
# This file is created by the capi-helm-chart to ensure that its parent directory exists | ||
owner: root:root | ||
permissions: "0644" | ||
{{- if ne .Values.osDistro "flatcar" }} | ||
- path: /etc/containerd/config.toml | ||
content: | | ||
[plugins."io.containerd.grpc.v1.cri".registry] | ||
config_path = "/etc/containerd/certs.d" | ||
owner: root:root | ||
permissions: "0644" | ||
append: true | ||
{{- end }} | ||
{{- with .Values.registryMirrors }} | ||
{{- range $registry, $registrySpec := . }} | ||
- path: /etc/containerd/certs.d/{{ $registry }}/hosts.toml | ||
|
@@ -275,3 +277,45 @@ Produces the spec for a KubeadmConfig object. | |
include "openstack-cluster.mergeConcatMany" | ||
}} | ||
{{- end }} | ||
|
||
{{/* | ||
Produces the spec for an Ignition based OS specific KubeadmConfig object conditional on osDistro set to "flatcar". | ||
*/}} | ||
{{- define "openstack-cluster.flatcarKubeadmConfigSpec" -}} | ||
initConfiguration: | ||
nodeRegistration: | ||
name: ${COREOS_OPENSTACK_HOSTNAME} | ||
joinConfiguration: | ||
nodeRegistration: | ||
name: ${COREOS_OPENSTACK_HOSTNAME} | ||
preKubeadmCommands: | ||
- export COREOS_OPENSTACK_HOSTNAME=${COREOS_OPENSTACK_HOSTNAME%.*} | ||
- envsubst < /etc/kubeadm.yml > /etc/kubeadm.yml.tmp | ||
- mv /etc/kubeadm.yml.tmp /etc/kubeadm.yml | ||
format: ignition | ||
ignition: | ||
containerLinuxConfig: | ||
additionalConfig: | | ||
systemd: | ||
units: | ||
- name: [email protected] | ||
enabled: true | ||
- name: kubeadm.service | ||
enabled: true | ||
dropins: | ||
- name: 10-flatcar.conf | ||
contents: | | ||
[Unit] | ||
Requires=containerd.service coreos-metadata.service | ||
After=containerd.service coreos-metadata.service | ||
[Service] | ||
EnvironmentFile=/run/metadata/flatcar | ||
{{- end }} | ||
|
||
{{- define "openstack-cluster.osDistroKubeadmConfigSpec" }} | ||
{{- $ctx := index . 0 }} | ||
{{- $osDistro := $ctx.Values.osDistro }} | ||
{{- if eq $osDistro "flatcar" }} | ||
{{- include "openstack-cluster.flatcarKubeadmConfigSpec" $ctx }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters