Repository navigation
fix(linux): remove bootstrap-kubeconfig after TLS bootstrapping - #9797
Cameron Meissner (cameronmeissner) wants to merge 27 commits into
Conversation
Windows Unit Test Results 3 files 18 suites 1m 4s ⏱️ Results for commit 5ed5ec9. ♻️ This comment has been updated with latest results. |
There was a problem hiding this comment.
🟡 Changes recommended
Script delivery, logging initialization, startup-timeout coupling, and incompatible validators introduce startup and E2E regressions.
4 open findings
What changed in this PR
This PR reduces credential retention during Linux node provisioning by removing bootstrap inputs after use.
Changes:
- Adds bootstrap-kubeconfig cleanup through a kubelet post-start hook.
- Restricts bootstrap-kubeconfig permissions and deletes node-controller inputs.
- Adds ShellSpec coverage and an E2E cleanup assertion.
| File | Description |
|---|---|
| spec/parts/linux/cloud-init/artifacts/remove-bootstrap-kubeconfig_spec.sh | Tests cleanup behavior and deletion failures. |
| parts/linux/cloud-init/artifacts/remove-bootstrap-kubeconfig.sh | Waits for kubeconfig, then removes bootstrap credentials. |
| parts/linux/cloud-init/artifacts/kubelet.service | Invokes cleanup after kubelet starts. |
| parts/linux/cloud-init/artifacts/cse_config_kubelet.sh | Restricts bootstrap credentials to mode 0600. |
| parts/linux/cloud-init/artifacts/aks-node-controller-launcher.sh | Deletes provisioning inputs after execution. |
| e2e/scenario/validators.go | Checks that bootstrap credentials were removed. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
AgentBaker Linux gate detectiveRun: 186034915 Detective summary: Run AgentBaker E2E failed after 32 scenarios passed and 75 were skipped; AzureLinuxV2 did not appear in the Kubernetes API and node listing hit a client rate-limiter context deadline, after which the run reported 88 failed scenarios. Likely cause / signature: e2e-shared-client-rate-limiter-context-deadline. Confidence: Medium-high. Timeline isolates the failure to e2e/Run AgentBaker E2E, the task log shows client rate limiter context deadline during node readiness, build metadata ties this to PR 9797, and an existing wiki row tracks this generic control-plane/client-deadline family. Recommended owner/action: Treat as shared E2E control-plane/client throttling or environment latency unless it repeats on this PR; no product code action is indicated from this single run. Strongest alternative: PR 9797 removed bootstrap-kubeconfig after TLS bootstrapping, but the observed failure is a generic Kubernetes API/list timeout after many unrelated scenarios, not bootstrap token validation or kubelet credential cleanup. Evidence: build run, failed timeline records for stage e2e/job Run AgentBaker E2E/task Run AgentBaker E2E, task log lines showing client rate limiter Wait returned an error: context deadline exceeded, source branch refs/pull/9797/merge, and wiki tracker. |
This reverts commit e658487.
There was a problem hiding this comment.
🔵 Needs a closer look
E2E compilation failures, unsafe shared-subnet deletion, and lost Bastion write limits remain unresolved.
6 open issues
Expected cleanup message does not match script output Cleanup setting missing from ANC typed configuration Synchronous certificate wait can time out kubelet startup Missing closing quote corrupts generated CSE command Cleanup helper missing from older supported VHDs OSGuard image omits bootstrap cleanup helper
1 resolved since last review
2 files not reviewed
aks-node-controller/pkg/gen/aksnodeconfig/v1/bootstrapping_config.pb.go: Generated fileaks-node-controller/pkg/gen/aksnodeconfig/v1/gpu_config.pb.go: Generated file
Review effort: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
Older-image compatibility and scriptless configuration and validation inconsistencies remain unresolved.
8 open issues
Expected cleanup message does not match script output Cleanup setting missing from ANC typed configuration Synchronous certificate wait can time out kubelet startup Missing closing quote corrupts generated CSE command RemoveBootstrapKubeconfig flag is lost during config conversion · New Legacy VHD lacks cleanup helper, leaving credentials on disk · New Cleanup helper missing from older supported VHDs OSGuard image omits bootstrap cleanup helper
2 files not reviewed
aks-node-controller/pkg/gen/aksnodeconfig/v1/bootstrapping_config.pb.go: Generated fileaks-node-controller/pkg/gen/aksnodeconfig/v1/gpu_config.pb.go: Generated file
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
The missing closing quote in the Linux CSE template blocks provisioning even when cleanup is disabled.
2 open issues
6 resolved since last review
Expected cleanup message does not match script output Cleanup setting missing from ANC typed configuration Synchronous certificate wait can time out kubelet startup Missing closing quote corrupts generated CSE command RemoveBootstrapKubeconfig flag is lost during config conversion Cleanup helper missing from older supported VHDs
1 file not reviewed
aks-node-controller/pkg/gen/aksnodeconfig/v1/bootstrapping_config.pb.go: Generated file
Review effort: Balanced
There was a problem hiding this comment.
🟡 Changes recommended
Unconditional E2E enablement breaks the frozen Azure Linux V2 scenario because its image lacks the cleanup helper.
1 open issue
2 resolved since last review
1 file not reviewed
aks-node-controller/pkg/gen/aksnodeconfig/v1/bootstrapping_config.pb.go: Generated file
Review effort: Balanced
…ssner/clean-token
There was a problem hiding this comment.
🔵 Needs a closer look
Kubelet startup timeout and older-image compatibility concerns remain unresolved.
No open issues 🎉
1 resolved since last review
1 file not reviewed
aks-node-controller/pkg/gen/aksnodeconfig/v1/bootstrapping_config.pb.go: Generated file
Review effort: Balanced
|


What this PR does / why we need it:
remove bootstrap-kubeconfig after TLS bootstrapping
Which issue(s) this PR fixes:
Fixes #