Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions test/extended/node/kubeletconfig_tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ import (

// This test suite validates that the kubelet TLS configuration can be upgraded
// from TLS 1.2 to TLS 1.3 via a KubeletConfig resource applied to a custom
// MachineConfigPool containing a single worker node. Using a custom pool
// avoids rebooting all workers and makes the test significantly faster.
var _ = g.Describe("[Suite:openshift/disruptive-longrunning][sig-node][Disruptive] Kubelet TLS configuration", func() {
// MachineConfigPool containing a single worker node.
// [Serial] because the MCP rollout restarts kubelet and static pods whose
// manifests embed TLS settings.
var _ = g.Describe("[sig-node][Serial] Kubelet TLS configuration", func() {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var (
oc = exutil.NewCLIWithoutNamespace("node-kubeletconfig-tls")
kubeletConfigName = "tls13-kubelet-config"
Expand Down Expand Up @@ -49,6 +50,12 @@ var _ = g.Describe("[Suite:openshift/disruptive-longrunning][sig-node][Disruptiv
o.Expect(isNodeInReadyState(&workerNodes[0])).To(o.BeTrue(), "Worker node %s is not in Ready state", testNode)
framework.Logf("Selected node %s for TLS upgrade test", testNode)

g.By("Recording node BootID before TLS change")
nodeSnapshot, err := oc.AdminKubeClient().CoreV1().Nodes().Get(ctx, testNode, metav1.GetOptions{})
o.Expect(err).NotTo(o.HaveOccurred())
originalBootID := nodeSnapshot.Status.NodeInfo.BootID
framework.Logf("Node %s BootID before change: %s", testNode, originalBootID)

g.By("Checking default TLS configuration")
nodeCfg, err := getKubeletConfigFromNode(ctx, oc, testNode)
o.Expect(err).NotTo(o.HaveOccurred(), "Error reading kubelet config from node %s", testNode)
Expand Down Expand Up @@ -119,7 +126,12 @@ var _ = g.Describe("[Suite:openshift/disruptive-longrunning][sig-node][Disruptiv
o.Expect(actualTLSVersion).To(o.Equal(expectedTLSVersion),
"TLS version should be %q, but got %q", expectedTLSVersion, actualTLSVersion)

framework.Logf("Successfully verified kubelet TLS upgrade from %s to %s on node %s",
g.By("Verifying no node reboot occurred (BootID unchanged)")
o.Expect(updatedNode.Status.NodeInfo.BootID).To(o.Equal(originalBootID),
"Node %s rebooted (BootID changed from %s to %s), expected only kubelet restart",
testNode, originalBootID, updatedNode.Status.NodeInfo.BootID)

framework.Logf("Successfully verified kubelet TLS upgrade from %s to %s on node %s without reboot",
defaultTLSVersion, actualTLSVersion, testNode)
})
})