diff --git a/controlplane/kubeadm/internal/filters.go b/controlplane/kubeadm/internal/filters.go index 45ad54e1a569..81f5100d38e2 100644 --- a/controlplane/kubeadm/internal/filters.go +++ b/controlplane/kubeadm/internal/filters.go @@ -316,10 +316,26 @@ func matchInitOrJoinConfiguration(machineConfig *bootstrapv1.KubeadmConfig, kcp } machineConfig = machineConfig.DeepCopy() + // Cleanup ControlPlaneComponentHealthCheckSeconds from machineConfig, + // because through conversion apiServer.timeoutForControlPlane in v1beta1 is converted to + // initConfiguration/joinConfiguration.timeouts.controlPlaneComponentHealthCheckSeconds in v1beta2 and + // this can lead to a diff here that would lead to a rollout. + // Note: Changes to ControlPlaneComponentHealthCheckSeconds will apply for the next join, but they will not lead to a rollout. + machineConfig.Spec.InitConfiguration.Timeouts.ControlPlaneComponentHealthCheckSeconds = nil + machineConfig.Spec.JoinConfiguration.Timeouts.ControlPlaneComponentHealthCheckSeconds = nil + // takes the KubeadmConfigSpec from KCP and applies the transformations required // to allow a comparison with the KubeadmConfig referenced from the machine. kcpConfig := getAdjustedKcpConfig(kcp, machineConfig) + // Cleanup ControlPlaneComponentHealthCheckSeconds from kcpConfig, + // because through conversion apiServer.timeoutForControlPlane in v1beta1 is converted to + // initConfiguration/joinConfiguration.timeouts.controlPlaneComponentHealthCheckSeconds in v1beta2 and + // this can lead to a diff here that would lead to a rollout. + // Note: Changes to ControlPlaneComponentHealthCheckSeconds will apply for the next join, but they will not lead to a rollout. + kcpConfig.InitConfiguration.Timeouts.ControlPlaneComponentHealthCheckSeconds = nil + kcpConfig.JoinConfiguration.Timeouts.ControlPlaneComponentHealthCheckSeconds = nil + // Default both KubeadmConfigSpecs before comparison. // *Note* This assumes that newly added default values never // introduce a semantic difference to the unset value. diff --git a/controlplane/kubeadm/internal/filters_test.go b/controlplane/kubeadm/internal/filters_test.go index 0d3157ec6529..eb8604164ab2 100644 --- a/controlplane/kubeadm/internal/filters_test.go +++ b/controlplane/kubeadm/internal/filters_test.go @@ -1127,7 +1127,11 @@ func TestMatchesKubeadmBootstrapConfig(t *testing.T) { KubeadmConfigSpec: bootstrapv1.KubeadmConfigSpec{ ClusterConfiguration: bootstrapv1.ClusterConfiguration{}, InitConfiguration: bootstrapv1.InitConfiguration{}, - JoinConfiguration: bootstrapv1.JoinConfiguration{}, + JoinConfiguration: bootstrapv1.JoinConfiguration{ + Timeouts: bootstrapv1.Timeouts{ + ControlPlaneComponentHealthCheckSeconds: ptr.To[int32](1), + }, + }, }, }, } @@ -1161,7 +1165,11 @@ func TestMatchesKubeadmBootstrapConfig(t *testing.T) { Name: "test", }, Spec: bootstrapv1.KubeadmConfigSpec{ - JoinConfiguration: bootstrapv1.JoinConfiguration{}, + JoinConfiguration: bootstrapv1.JoinConfiguration{ + Timeouts: bootstrapv1.Timeouts{ + ControlPlaneComponentHealthCheckSeconds: ptr.To[int32](2), + }, + }, }, }, } diff --git a/test/e2e/data/infrastructure-docker/v1.10/clusterclass-quick-start.yaml b/test/e2e/data/infrastructure-docker/v1.10/clusterclass-quick-start.yaml index e3b77e871f91..10083febe813 100644 --- a/test/e2e/data/infrastructure-docker/v1.10/clusterclass-quick-start.yaml +++ b/test/e2e/data/infrastructure-docker/v1.10/clusterclass-quick-start.yaml @@ -554,6 +554,7 @@ spec: apiServer: extraArgs: v: "0" + timeoutForControlPlane: 4m # host.docker.internal is required by kubetest when running on MacOS because of the way ports are proxied. certSANs: [localhost, host.docker.internal, "::", "::1", "127.0.0.1", "0.0.0.0"] initConfiguration: