Skip to content

feat(windows): add support for configuring secure TLS bootstrap client RPC timeouts#8398

Open
cameronmeissner wants to merge 1 commit intomainfrom
cameissnere/stls-rpc-timeouts-windows
Open

feat(windows): add support for configuring secure TLS bootstrap client RPC timeouts#8398
cameronmeissner wants to merge 1 commit intomainfrom
cameissnere/stls-rpc-timeouts-windows

Conversation

@cameronmeissner
Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
add support for configuring secure TLS bootstrap client RPC timeouts - this PR is the Windows analog to #8261, which added the same support for Linux.

Which issue(s) this PR fixes:

Fixes #

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Windows support for configuring per-RPC timeouts (and deadline) for the aks-secure-tls-bootstrap-client.exe invocation, aligning Windows secure TLS bootstrapping configurability with the existing Linux work (#8261).

Changes:

  • Extends securetlsbootstrap.ps1 to accept and forward individual RPC timeout flags to the bootstrap client.
  • Plumbs new SecureTLSBootstrapArgs fields through kubelet startup flow (kubeletstart.ps1).
  • Adds new templated variables for these timeouts in the Windows CSE entrypoint (kuberneteswindowssetup.ps1) and writes them into kubeclusterconfig.json (kubernetesfunc.ps1).

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
staging/cse/windows/provisioningscripts/securetlsbootstrap.ps1 Adds new optional parameters and conditionally appends corresponding bootstrap client flags.
staging/cse/windows/provisioningscripts/kubeletstart.ps1 Reads new SecureTLSBootstrapArgs fields from kubeclusterconfig.json and forwards them to securetlsbootstrap.ps1.
staging/cse/windows/kubernetesfunc.ps1 Writes SecureTLSBootstrapArgs into kubeclusterconfig.json (but currently uses incorrect global variable names for the new fields).
parts/windows/kuberneteswindowssetup.ps1 Introduces templated variables to configure the new timeouts/deadline for Windows nodes.

Comment on lines +137 to +138
GetCredentialTimeout = $global:GetCredentialTimeout;
Deadline = $global:Deadline
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

Deadline (and GetCredentialTimeout) are being read from $global:Deadline / $global:GetCredentialTimeout, but the globals set by the Windows setup script are $global:SecureTLSBootstrappingDeadline and $global:SecureTLSBootstrappingGetCredentialTimeout. This prevents the configured deadline/timeouts from being written into kubeclusterconfig.json.

Suggested change
GetCredentialTimeout = $global:GetCredentialTimeout;
Deadline = $global:Deadline
GetCredentialTimeout = $global:SecureTLSBootstrappingGetCredentialTimeout;
Deadline = $global:SecureTLSBootstrappingDeadline

Copilot uses AI. Check for mistakes.
Comment on lines 117 to 118
if (![string]::IsNullOrEmpty($global:SecureTLSBootstrapAADResource)) {
$SecureTLSBootstrappingArgs["AADResource"] = "$global:SecureTLSBootstrapAADResource"
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

The AAD resource value is never passed into securetlsbootstrap because this block checks/uses $global:SecureTLSBootstrapAADResource, but the variable initialized from kubeclusterconfig.json is $global:SecureTLSBootstrappingAADResource (note the missing "ping"). Use the same variable name so AADResource is forwarded when configured.

Suggested change
if (![string]::IsNullOrEmpty($global:SecureTLSBootstrapAADResource)) {
$SecureTLSBootstrappingArgs["AADResource"] = "$global:SecureTLSBootstrapAADResource"
if (![string]::IsNullOrEmpty($global:SecureTLSBootstrappingAADResource)) {
$SecureTLSBootstrappingArgs["AADResource"] = "$global:SecureTLSBootstrappingAADResource"

Copilot uses AI. Check for mistakes.
Comment on lines +132 to +138
ValidateKubeconfigTimeout = $global:ValidateKubeconfigTimeout;
GetAccessTokenTimeout = $global:GetAccessTokenTimeout;
GetInstanceDataTimeout = $global:GetInstanceDataTimeout;
GetNonceTimeout = $global:GetNonceTimeout;
GetAttestedDataTimeout = $global:GetAttestedDataTimeout;
GetCredentialTimeout = $global:GetCredentialTimeout;
Deadline = $global:Deadline
Copy link

Copilot AI Apr 24, 2026

Choose a reason for hiding this comment

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

Write-KubeClusterConfig is populating SecureTLSBootstrapArgs from $global:ValidateKubeconfigTimeout, $global:GetAccessTokenTimeout, etc., but those globals are never set (the setup script defines $global:SecureTLSBootstrappingValidateKubeconfigTimeout, $global:SecureTLSBootstrappingGetAccessTokenTimeout, etc.). As written, these values will be missing from kubeclusterconfig.json and won't reach kubeletstart/securetlsbootstrap.

Suggested change
ValidateKubeconfigTimeout = $global:ValidateKubeconfigTimeout;
GetAccessTokenTimeout = $global:GetAccessTokenTimeout;
GetInstanceDataTimeout = $global:GetInstanceDataTimeout;
GetNonceTimeout = $global:GetNonceTimeout;
GetAttestedDataTimeout = $global:GetAttestedDataTimeout;
GetCredentialTimeout = $global:GetCredentialTimeout;
Deadline = $global:Deadline
ValidateKubeconfigTimeout = $global:SecureTLSBootstrappingValidateKubeconfigTimeout;
GetAccessTokenTimeout = $global:SecureTLSBootstrappingGetAccessTokenTimeout;
GetInstanceDataTimeout = $global:SecureTLSBootstrappingGetInstanceDataTimeout;
GetNonceTimeout = $global:SecureTLSBootstrappingGetNonceTimeout;
GetAttestedDataTimeout = $global:SecureTLSBootstrappingGetAttestedDataTimeout;
GetCredentialTimeout = $global:SecureTLSBootstrappingGetCredentialTimeout;
Deadline = $global:SecureTLSBootstrappingDeadline

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

windows cse package The change with this label needs to build a new AKS Windows CSE Scripts Package. windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants