From 48d1179f950b74114419ff5e6251c461888bc84f Mon Sep 17 00:00:00 2001 From: Fabien Boucher Date: Thu, 19 Oct 2023 08:43:49 +0000 Subject: [PATCH] nodepool-builder - fix .ssh/known_hosts wipe after pod restart Thix change fix an issue where the known_hosts file is wiped due to the usage of the EmptyDir volume. Change-Id: I4614b8f7d2b9f0bffe01057260185bd1b02c8bf0 --- controllers/nodepool.go | 7 +------ controllers/static/nodepool/ssh_config | 1 + 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/controllers/nodepool.go b/controllers/nodepool.go index dcada6cc..03516929 100644 --- a/controllers/nodepool.go +++ b/controllers/nodepool.go @@ -349,7 +349,6 @@ func (r *SFController) DeployNodepoolBuilder(statsdExporterVolume apiv1.Volume, base.MkVolumeSecret("zookeeper-client-tls"), base.MkVolumeSecret(NodepoolProvidersSecretsName), base.MkEmptyDirVolume("nodepool-config"), - base.MkEmptyDirVolume("nodepool-home-ssh"), r.commonToolingVolume(), { Name: "nodepool-builder-ssh-key", @@ -390,10 +389,6 @@ func (r *SFController) DeployNodepoolBuilder(statsdExporterVolume apiv1.Volume, MountPath: "/var/lib/nodepool-ssh-key", ReadOnly: true, }, - { - Name: "nodepool-home-ssh", - MountPath: "/var/lib/nodepool/.ssh", - }, { Name: "nodepool-tooling-vol", SubPath: "ssh_config", @@ -421,7 +416,7 @@ func (r *SFController) DeployNodepoolBuilder(statsdExporterVolume apiv1.Volume, "statsd_mapping": utils.Checksum([]byte(nodepoolStatsdMappingConfig)), // When the Secret ResourceVersion field change (when edited) we force a nodepool-builder restart "nodepool-providers-secrets": string(nodepoolProvidersSecrets.ResourceVersion), - "serial": "8", + "serial": "9", } initContainer := base.MkContainer("nodepool-builder-init", base.BusyboxImage) diff --git a/controllers/static/nodepool/ssh_config b/controllers/static/nodepool/ssh_config index cd983603..4e7fee90 100644 --- a/controllers/static/nodepool/ssh_config +++ b/controllers/static/nodepool/ssh_config @@ -1,2 +1,3 @@ Host * IdentityFile /var/lib/nodepool-ssh-key/priv + UserKnownHostsFile /var/lib/nodepool/known_hosts