From b951aca66fe728d9c382f3cb5c637bac71311c73 Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Wed, 18 Sep 2019 23:56:17 -0700 Subject: [PATCH] Create /etc/kubernetes/manifests before asset copy * Fix issue (present since bootkube->bootstrap switch) where controller asset copy could fail if /etc/kubernetes/manifests wasn't created in time on platforms using path activation for the Kubelet (observed on DigitalOcean, also possible on bare-metal) --- aws/container-linux/kubernetes/ssh.tf | 1 + aws/fedora-coreos/kubernetes/ssh.tf | 1 + azure/container-linux/kubernetes/ssh.tf | 1 + bare-metal/container-linux/kubernetes/ssh.tf | 3 ++- bare-metal/fedora-coreos/kubernetes/ssh.tf | 3 ++- digital-ocean/container-linux/kubernetes/ssh.tf | 3 ++- google-cloud/container-linux/kubernetes/ssh.tf | 1 + 7 files changed, 10 insertions(+), 3 deletions(-) diff --git a/aws/container-linux/kubernetes/ssh.tf b/aws/container-linux/kubernetes/ssh.tf index 4ebd5f24..1821e195 100644 --- a/aws/container-linux/kubernetes/ssh.tf +++ b/aws/container-linux/kubernetes/ssh.tf @@ -66,6 +66,7 @@ resource "null_resource" "copy-controller-secrets" { "sudo chown -R etcd:etcd /etc/ssl/etcd", "sudo chmod -R 500 /etc/ssl/etcd", "sudo mv $HOME/assets /opt/bootstrap/assets", + "sudo mkdir -p /etc/kubernetes/manifests", "sudo mkdir -p /etc/kubernetes/bootstrap-secrets", "sudo cp -r /opt/bootstrap/assets/tls/* /etc/kubernetes/bootstrap-secrets/", "sudo cp /opt/bootstrap/assets/auth/kubeconfig /etc/kubernetes/bootstrap-secrets/", diff --git a/aws/fedora-coreos/kubernetes/ssh.tf b/aws/fedora-coreos/kubernetes/ssh.tf index 2e2cc3fe..339e9596 100644 --- a/aws/fedora-coreos/kubernetes/ssh.tf +++ b/aws/fedora-coreos/kubernetes/ssh.tf @@ -66,6 +66,7 @@ resource "null_resource" "copy-controller-secrets" { "sudo chown -R etcd:etcd /etc/ssl/etcd", "sudo chmod -R 500 /etc/ssl/etcd", "sudo mv $HOME/assets /opt/bootstrap/assets", + "sudo mkdir -p /etc/kubernetes/manifests", "sudo mkdir -p /etc/kubernetes/bootstrap-secrets", "sudo cp -r /opt/bootstrap/assets/tls/* /etc/kubernetes/bootstrap-secrets/", "sudo cp /opt/bootstrap/assets/auth/kubeconfig /etc/kubernetes/bootstrap-secrets/", diff --git a/azure/container-linux/kubernetes/ssh.tf b/azure/container-linux/kubernetes/ssh.tf index f8012c27..159d74f7 100644 --- a/azure/container-linux/kubernetes/ssh.tf +++ b/azure/container-linux/kubernetes/ssh.tf @@ -67,6 +67,7 @@ resource "null_resource" "copy-controller-secrets" { "sudo chown -R etcd:etcd /etc/ssl/etcd", "sudo chmod -R 500 /etc/ssl/etcd", "sudo mv $HOME/assets /opt/bootstrap/assets", + "sudo mkdir -p /etc/kubernetes/manifests", "sudo mkdir -p /etc/kubernetes/bootstrap-secrets", "sudo cp -r /opt/bootstrap/assets/tls/* /etc/kubernetes/bootstrap-secrets/", "sudo cp /opt/bootstrap/assets/auth/kubeconfig /etc/kubernetes/bootstrap-secrets/", diff --git a/bare-metal/container-linux/kubernetes/ssh.tf b/bare-metal/container-linux/kubernetes/ssh.tf index 2a85da6c..a9674f98 100644 --- a/bare-metal/container-linux/kubernetes/ssh.tf +++ b/bare-metal/container-linux/kubernetes/ssh.tf @@ -75,9 +75,10 @@ resource "null_resource" "copy-controller-secrets" { "sudo mv etcd-peer.key /etc/ssl/etcd/etcd/peer.key", "sudo chown -R etcd:etcd /etc/ssl/etcd", "sudo chmod -R 500 /etc/ssl/etcd", - "sudo mv $HOME/kubeconfig /etc/kubernetes/kubeconfig", "sudo mv $HOME/assets /opt/bootstrap/assets", + "sudo mkdir -p /etc/kubernetes/manifests" "sudo mkdir -p /etc/kubernetes/bootstrap-secrets", + "sudo mv $HOME/kubeconfig /etc/kubernetes/kubeconfig", "sudo cp -r /opt/bootstrap/assets/tls/* /etc/kubernetes/bootstrap-secrets/", "sudo cp /opt/bootstrap/assets/auth/kubeconfig /etc/kubernetes/bootstrap-secrets/", "sudo cp -r /opt/bootstrap/assets/static-manifests/* /etc/kubernetes/manifests/", diff --git a/bare-metal/fedora-coreos/kubernetes/ssh.tf b/bare-metal/fedora-coreos/kubernetes/ssh.tf index 002faf1f..93180195 100644 --- a/bare-metal/fedora-coreos/kubernetes/ssh.tf +++ b/bare-metal/fedora-coreos/kubernetes/ssh.tf @@ -72,9 +72,10 @@ resource "null_resource" "copy-controller-secrets" { "sudo cp /etc/ssl/etcd/etcd-client-ca.crt /etc/ssl/etcd/etcd/peer-ca.crt", "sudo mv etcd-peer.crt /etc/ssl/etcd/etcd/peer.crt", "sudo mv etcd-peer.key /etc/ssl/etcd/etcd/peer.key", - "sudo mv $HOME/kubeconfig /etc/kubernetes/kubeconfig", "sudo mv $HOME/assets /opt/bootstrap/assets", + "sudo mkdir -p /etc/kubernetes/manifests" "sudo mkdir -p /etc/kubernetes/bootstrap-secrets", + "sudo mv $HOME/kubeconfig /etc/kubernetes/kubeconfig", "sudo cp -r /opt/bootstrap/assets/tls/* /etc/kubernetes/bootstrap-secrets/", "sudo cp /opt/bootstrap/assets/auth/kubeconfig /etc/kubernetes/bootstrap-secrets/", "sudo cp -r /opt/bootstrap/assets/static-manifests/* /etc/kubernetes/manifests/" diff --git a/digital-ocean/container-linux/kubernetes/ssh.tf b/digital-ocean/container-linux/kubernetes/ssh.tf index a1b734d1..fbc9ebf7 100644 --- a/digital-ocean/container-linux/kubernetes/ssh.tf +++ b/digital-ocean/container-linux/kubernetes/ssh.tf @@ -71,9 +71,10 @@ resource "null_resource" "copy-controller-secrets" { "sudo mv etcd-peer.key /etc/ssl/etcd/etcd/peer.key", "sudo chown -R etcd:etcd /etc/ssl/etcd", "sudo chmod -R 500 /etc/ssl/etcd", - "sudo mv $HOME/kubeconfig /etc/kubernetes/kubeconfig", "sudo mv $HOME/assets /opt/bootstrap/assets", + "sudo mkdir -p /etc/kubernetes/manifests" "sudo mkdir -p /etc/kubernetes/bootstrap-secrets", + "sudo mv $HOME/kubeconfig /etc/kubernetes/kubeconfig", "sudo cp -r /opt/bootstrap/assets/tls/* /etc/kubernetes/bootstrap-secrets/", "sudo cp /opt/bootstrap/assets/auth/kubeconfig /etc/kubernetes/bootstrap-secrets/", "sudo cp -r /opt/bootstrap/assets/static-manifests/* /etc/kubernetes/manifests/", diff --git a/google-cloud/container-linux/kubernetes/ssh.tf b/google-cloud/container-linux/kubernetes/ssh.tf index b4229674..d86fad75 100644 --- a/google-cloud/container-linux/kubernetes/ssh.tf +++ b/google-cloud/container-linux/kubernetes/ssh.tf @@ -66,6 +66,7 @@ resource "null_resource" "copy-controller-secrets" { "sudo chown -R etcd:etcd /etc/ssl/etcd", "sudo chmod -R 500 /etc/ssl/etcd", "sudo mv $HOME/assets /opt/bootstrap/assets", + "sudo mkdir -p /etc/kubernetes/manifests", "sudo mkdir -p /etc/kubernetes/bootstrap-secrets", "sudo cp -r /opt/bootstrap/assets/tls/* /etc/kubernetes/bootstrap-secrets/", "sudo cp /opt/bootstrap/assets/auth/kubeconfig /etc/kubernetes/bootstrap-secrets/",