Skip to content

Commit

Permalink
Completely remove kubelet-config component
Browse files Browse the repository at this point in the history
K0s 1.29 did a full removal of the component from the cluster. Remove
the old kubelet-config component completely now. Leave some checks in
the integration tests that verify the non-existence of the manifest
folder of the kubelet-config stack for current versions of k0s.

See: 412b3c6 ("Remove kubelet-config stack after deprecation in 1.26")
See: 9d0a317 ("Replace kubelet-config with worker-config component")
Signed-off-by: Tom Wieczorek <[email protected]>
  • Loading branch information
twz123 committed Apr 29, 2024
1 parent 61c9c7b commit 5328a56
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 196 deletions.
1 change: 0 additions & 1 deletion cmd/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,6 @@ func (c *command) start(ctx context.Context) error {
return err
}
clusterComponents.Add(ctx, reconciler)
clusterComponents.Add(ctx, controller.NewKubeletConfig(c.K0sVars))
}

if !slices.Contains(c.DisableComponents, constant.SystemRbacComponentName) {
Expand Down
30 changes: 21 additions & 9 deletions inttest/ap-ha3x3/ha3x3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,11 @@ spec:
s.Require().NoError(err)
defer sshController.Disconnect()

if version, err := s.GetK0sVersion(s.ControllerNode(0)); s.NoError(err, "Failed to get the base k0s version") {
hasOldStack := version != s.k0sUpdateVersion && (strings.HasPrefix(version, "v1.27.") || strings.HasPrefix(version, "v1.28."))
var hasOldStack bool
if version, err := s.GetK0sVersion(s.ControllerNode(0)); s.NoError(err, "Failed to get the base k0s version, assuming no old stack!") {
hasOldStack = version != s.k0sUpdateVersion && strings.HasPrefix(version, "v1.29.")
s.T().Logf("Base k0s version: %q, has old stack: %v", version, hasOldStack)
s.checkKubeletConfigStackResources(ctx, sshController, hasOldStack)
s.checkKubeletConfigStackResources(ctx, sshController, strings.HasPrefix(version, "v1.28."))
}

sshWorker, err := s.SSH(ctx, s.WorkerNode(0))
Expand Down Expand Up @@ -201,12 +202,23 @@ spec:
}

for idx := 0; idx < s.ControllerCount; idx++ {
func() {
ssh, err := s.SSH(ctx, s.ControllerNode(idx))
s.Require().NoError(err)
defer ssh.Disconnect()
s.checkKubeletConfigComponentFolders(ctx, ssh)
}()
node := s.ControllerNode(idx)
if hasOldStack {
s.Run("kubelet-config_component_removal/"+node, func() {
ssh, err := s.SSH(ctx, node)
s.Require().NoError(err)
defer ssh.Disconnect()
s.checkKubeletConfigComponentFolders(ctx, ssh)
})
} else {
s.Run("kubelet-config_component_nonexistence/"+node, func() {
ssh, err := s.SSH(ctx, node)
s.Require().NoError(err)
defer ssh.Disconnect()
err = ssh.Exec(ctx, "[ ! -d /var/lib/k0s/manifests/kubelet ]", common.SSHStreams{})
s.NoError(err, "Failed to verify if kubelet manifest folder doesn't exist")
})
}
}

s.checkKubeletConfigStackResources(ctx, sshController, false)
Expand Down
93 changes: 0 additions & 93 deletions pkg/component/controller/kubeletconfig.go

This file was deleted.

93 changes: 0 additions & 93 deletions pkg/component/controller/kubeletconfig_test.go

This file was deleted.

0 comments on commit 5328a56

Please sign in to comment.