From 3c7122e91872c2946e04314d21fa8d8a25a53a15 Mon Sep 17 00:00:00 2001 From: Iago Lopez Galeiras Date: Tue, 29 Jun 2021 15:42:24 +0200 Subject: [PATCH] terraform: remove kubeconfig ConditionPathExists on kubelet.service It has been added to the [Service] section which meant it had no effect. Adding it to the right place (the [Unit] section) means /etc/kubernetes/kubeconfig must exist the first time the Kubelet starts, otherwise the unit is skipped and it never tries to start again. This removes that directive: it's fine to have the kubelet try to start again and again until the file exists. --- .../aws/flatcar-linux/kubernetes/cl/controller.yaml.tmpl | 1 - assets/terraform-modules/controller/main.tf | 1 - assets/terraform-modules/node/templates/node.yaml.tmpl | 1 - .../packet/flatcar-linux/kubernetes/cl/controller.yaml.tmpl | 1 - 4 files changed, 4 deletions(-) diff --git a/assets/terraform-modules/aws/flatcar-linux/kubernetes/cl/controller.yaml.tmpl b/assets/terraform-modules/aws/flatcar-linux/kubernetes/cl/controller.yaml.tmpl index 73ef1267c..db4de1a15 100644 --- a/assets/terraform-modules/aws/flatcar-linux/kubernetes/cl/controller.yaml.tmpl +++ b/assets/terraform-modules/aws/flatcar-linux/kubernetes/cl/controller.yaml.tmpl @@ -64,7 +64,6 @@ systemd: [Unit] Description=Kubelet Wants=rpc-statd.service - ConditionPathExists=/etc/kubernetes/kubeconfig [Service] EnvironmentFile=/etc/kubernetes/kubelet.env ExecStartPre=/bin/mkdir -p /var/lib/kubelet/volumeplugins diff --git a/assets/terraform-modules/controller/main.tf b/assets/terraform-modules/controller/main.tf index 7f8343ea1..d92aee363 100644 --- a/assets/terraform-modules/controller/main.tf +++ b/assets/terraform-modules/controller/main.tf @@ -7,7 +7,6 @@ systemd: - name: 10-controller.conf contents: | [Unit] - ConditionPathExists=/etc/kubernetes/kubeconfig [Service] ExecStartPre=/bin/mkdir -p /etc/kubernetes/checkpoint-secrets ExecStartPre=/bin/mkdir -p /etc/kubernetes/inactive-manifests diff --git a/assets/terraform-modules/node/templates/node.yaml.tmpl b/assets/terraform-modules/node/templates/node.yaml.tmpl index b09d55740..943b9596e 100644 --- a/assets/terraform-modules/node/templates/node.yaml.tmpl +++ b/assets/terraform-modules/node/templates/node.yaml.tmpl @@ -26,7 +26,6 @@ systemd: [Unit] Description=Kubelet Wants=rpc-statd.service - ConditionPathExists=/etc/kubernetes/kubeconfig [Service] EnvironmentFile=/etc/kubernetes/kubelet.env ExecStartPre=/bin/mkdir -p /var/lib/kubelet/volumeplugins diff --git a/assets/terraform-modules/packet/flatcar-linux/kubernetes/cl/controller.yaml.tmpl b/assets/terraform-modules/packet/flatcar-linux/kubernetes/cl/controller.yaml.tmpl index edc841edd..d66d5e6c4 100644 --- a/assets/terraform-modules/packet/flatcar-linux/kubernetes/cl/controller.yaml.tmpl +++ b/assets/terraform-modules/packet/flatcar-linux/kubernetes/cl/controller.yaml.tmpl @@ -101,7 +101,6 @@ systemd: Requires=coreos-metadata.service After=coreos-metadata.service Wants=rpc-statd.service - ConditionPathExists=/etc/kubernetes/kubeconfig [Service] EnvironmentFile=/run/metadata/flatcar EnvironmentFile=/etc/kubernetes/kubelet.env