From d10cd74b3b2bf82cf19b74f1f2ea942c87ff74af Mon Sep 17 00:00:00 2001 From: Tobias Wolf Date: Mon, 23 May 2022 21:08:34 +0200 Subject: [PATCH] Temporarily work around issues with a valid hostname for pods in MCM This reverts commit 800ea461fbb994192c9b1bc712634f71642f8955. --- charts/images.yaml | 2 +- example/30-infrastructure.yaml | 7 ++++--- pkg/webhook/controlplane/ensurer.go | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/charts/images.yaml b/charts/images.yaml index 81174804..a17f8123 100644 --- a/charts/images.yaml +++ b/charts/images.yaml @@ -26,7 +26,7 @@ images: - name: machine-controller-manager-provider-ionos sourceRepository: https://github.com/23technologies/machine-controller-manager-provider-ionos repository: ghcr.io/23technologies/machine-controller-manager-provider-ionos - tag: v0.1.4 + tag: v0.1.5 - name: csi-driver-controller sourceRepository: https://github.com/ionos-cloud/ repository: registry.k8s.cluster.ionos.com/kore/ionos-csi diff --git a/example/30-infrastructure.yaml b/example/30-infrastructure.yaml index d2ba6ba9..bc268cae 100644 --- a/example/30-infrastructure.yaml +++ b/example/30-infrastructure.yaml @@ -82,7 +82,7 @@ spec: version: "20.04" cores: 1 memory: 1024 - ip: 10.15.100.254 + ip: 10.15.100.253 userData: |- #cloud-config runcmd: @@ -113,8 +113,9 @@ spec: bogus-priv listen-address=127.0.0.1 listen-address=::1 - listen-address=10.15.100.254 - dhcp-range=set:workers,10.15.100.0,10.15.100.253,24h + listen-address=10.15.100.253 + dhcp-range=set:workers,10.15.100.0,10.15.100.252,24h + dhcp-ignore-names=tag:workers dhcp-option=tag:workers,option:router volumeSize: 10737418240 floatingPool: diff --git a/pkg/webhook/controlplane/ensurer.go b/pkg/webhook/controlplane/ensurer.go index 2dbfd364..25cdcdd6 100644 --- a/pkg/webhook/controlplane/ensurer.go +++ b/pkg/webhook/controlplane/ensurer.go @@ -115,7 +115,7 @@ func (e *ensurer) EnsureKubeletServiceUnitOptions(ctx context.Context, gctx gcon new = extensionswebhook.EnsureUnitOption(new, &unit.UnitOption{ Section: "Service", Name: "ExecStartPre", - Value: `/bin/sh -c 'hostnamectl set-hostname $(uuidgen)'`, + Value: `/bin/sh -c 'hostnamectl set-hostname $(cat /etc/hostname | cut -d '.' -f 1)'`, }) return new, nil }