Workaround systemd 248 path units not working reliably

* On FCOS 34 / systemd 248, `kubelet.path` won't activate (stuck
waiting) when `/etc/kubernetes/kubeconfig` exists, even with
manual prodding of the file. The root cause isn't known, but
a workaround is to delay `/etc/kubernetes` directory creation
or to touch the directory later
* Fix DigitalOcean worker node kubelet.service being enabled
immediately. On bare-metal and DigitalOcean, the kubeconfig
should activate the Kubelet, so it doesn't crashloop needlessly
(nice to have, not required)
This commit is contained in:
Dalton Hubble 2021-06-15 18:25:10 -07:00
parent f2b01e1d75
commit d77343be3a
2 changed files with 4 additions and 1 deletions

View File

@ -39,6 +39,7 @@ resource "null_resource" "copy-controller-secrets" {
provisioner "remote-exec" { provisioner "remote-exec" {
inline = [ inline = [
"sudo mv $HOME/kubeconfig /etc/kubernetes/kubeconfig", "sudo mv $HOME/kubeconfig /etc/kubernetes/kubeconfig",
"sudo touch /etc/kubernetes",
"sudo /opt/bootstrap/layout", "sudo /opt/bootstrap/layout",
] ]
} }
@ -70,6 +71,7 @@ resource "null_resource" "copy-worker-secrets" {
provisioner "remote-exec" { provisioner "remote-exec" {
inline = [ inline = [
"sudo mv $HOME/kubeconfig /etc/kubernetes/kubeconfig", "sudo mv $HOME/kubeconfig /etc/kubernetes/kubeconfig",
"sudo touch /etc/kubernetes",
] ]
} }
} }

View File

@ -36,6 +36,7 @@ resource "null_resource" "copy-controller-secrets" {
provisioner "remote-exec" { provisioner "remote-exec" {
inline = [ inline = [
"sudo mv $HOME/kubeconfig /etc/kubernetes/kubeconfig", "sudo mv $HOME/kubeconfig /etc/kubernetes/kubeconfig",
"sudo touch /etc/kubernetes",
"sudo /opt/bootstrap/layout", "sudo /opt/bootstrap/layout",
] ]
} }
@ -60,6 +61,7 @@ resource "null_resource" "copy-worker-secrets" {
provisioner "remote-exec" { provisioner "remote-exec" {
inline = [ inline = [
"sudo mv $HOME/kubeconfig /etc/kubernetes/kubeconfig", "sudo mv $HOME/kubeconfig /etc/kubernetes/kubeconfig",
"sudo touch /etc/kubernetes",
] ]
} }
} }
@ -84,4 +86,3 @@ resource "null_resource" "bootstrap" {
] ]
} }
} }