Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bare-metal: support cached install for Flatcar #315

Closed

Conversation

schu
Copy link
Contributor

@schu schu commented Oct 15, 2018

Add support for the "cached install" variant (assets are fetched from
matchbox and not the upstream server) for Flatcar.

Also, remove a hardcoded coreos and use ${os_flavor} instead to make
the code work for both Container Linux and Flatcar based installs.

@@ -54,7 +54,7 @@ systemd:
ExecStartPre=/bin/mkdir -p /var/lib/kubelet/volumeplugins
ExecStartPre=/usr/bin/bash -c "grep 'certificate-authority-data' /etc/kubernetes/kubeconfig | awk '{print $2}' | base64 -d > /etc/kubernetes/ca.crt"
ExecStartPre=-/usr/bin/rkt rm --uuid-file=/var/cache/kubelet-pod.uuid
ExecStart=/usr/lib/coreos/kubelet-wrapper \
ExecStart=/usr/lib/${os_flavor}/kubelet-wrapper \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove

@@ -114,6 +114,30 @@ resource "matchbox_profile" "flatcar-install" {
container_linux_config = "${element(data.template_file.container-linux-install-configs.*.rendered, count.index)}"
}

// Flatcar Linux Install profile (from matchbox /assets cache)
// Note: Admin must have downloaded os_version into matchbox assets.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

into matchbox assets/flatcar

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed, also in the comment above for the cached container linux install.

@@ -136,6 +160,7 @@ data "template_file" "controller-configs" {
template = "${file("${path.module}/cl/controller.yaml.tmpl")}"

vars {
os_flavor = "${local.flavor}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be needed

@@ -167,6 +192,7 @@ data "template_file" "worker-configs" {
template = "${file("${path.module}/cl/worker.yaml.tmpl")}"

vars {
os_flavor = "${local.flavor}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

@dghubble
Copy link
Member

dghubble commented Oct 16, 2018

Have you given consideration to #209 (comment)? Is there a get-flatcar script Flatcar users would likely use that arranges files in the right way (somewhere in Flatcar repos, not in Typhoon)? Analogous to the get-coreos script

@@ -81,7 +81,7 @@ systemd:
ExecStartPre=/bin/mkdir -p /var/lib/kubelet/volumeplugins
ExecStartPre=/usr/bin/bash -c "grep 'certificate-authority-data' /etc/kubernetes/kubeconfig | awk '{print $2}' | base64 -d > /etc/kubernetes/ca.crt"
ExecStartPre=-/usr/bin/rkt rm --uuid-file=/var/cache/kubelet-pod.uuid
ExecStart=/usr/lib/coreos/kubelet-wrapper \
ExecStart=/usr/lib/${os_flavor}/kubelet-wrapper \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be needed for this change since Flatcar keeps the kubelet-wrapper in the same location

Copy link
Contributor Author

@schu schu Oct 16, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, there's a symlink. I hit an error before but cannot reproduce it. Removed.

Add support for the "cached install" variant (assets are fetched from
matchbox and not the upstream server) for Flatcar.

Also, remove a hardcoded `coreos` and use `${os_flavor}` instead to make
the code work for both Container Linux and Flatcar based installs.
@schu schu force-pushed the schu/flatcar-cached-install branch from 5e3b8bc to fc3fa9b Compare October 16, 2018 16:15
@schu
Copy link
Contributor Author

schu commented Oct 16, 2018

Have you given consideration to #209 (comment)? Is there a get-flatcar script Flatcar users would likely use that arranges files in the right way (somewhere in Flatcar repos, not in Typhoon)? Analogous to the get-coreos script

Thanks for the pointer, I wasn't aware of the comment. We have a similar script for Flatcar (adapted from get-coreos). Would you like me to send a PR for adding it to https://github.com/coreos/matchbox? Or should we make get-coreos e.g. get-assets and make it work for both?

@dghubble
Copy link
Member

Thanks!

I think a get-flatcar script alongside the get-coreos one in Matchbox would be great.

@dghubble
Copy link
Member

Rebased and added a CHANGELOG and docs update to merge in d10620f Thanks!

@dghubble dghubble closed this Oct 17, 2018
@schu
Copy link
Contributor Author

schu commented Oct 17, 2018

@dghubble thank you.

@schu schu deleted the schu/flatcar-cached-install branch October 17, 2018 06:39
schu added a commit to schu/matchbox that referenced this pull request Oct 29, 2018
Similar to `get-coreos`, add a helper script `get-flatcar` to download
Flatcar assets.

Follow up on poseidon/typhoon#315
schu added a commit to schu/matchbox that referenced this pull request Oct 29, 2018
Similar to `get-coreos`, add a helper script `get-flatcar` to download
Flatcar assets.

Follow up for poseidon/typhoon#315
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants