fix: allow DNS failover during CSE connectivity checks#8985
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8618f8d1-4a31-43a9-92d7-0ba79b33675f
r2k1
requested review from
AbelHu,
Devinwong,
SriHarsha001,
awesomenix,
calvin197,
cameronmeissner,
djsly,
ganeshkumarashok,
karenychen,
lilypan26,
mxj220,
pdamianov-dev,
phealy,
runzhen,
sulixu,
timmy-wright,
titilambert,
xuexu6666 and
zachary-bailey
as code owners
July 20, 2026 15:13
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the Linux CSE outbound connectivity preflight retry parameters in cse_main.sh to better tolerate DNS failover scenarios (e.g., an unresponsive primary custom DNS server) while slightly reducing the overall worst-case retry window. It fits into the Linux node provisioning path (nodePrep) where outbound connectivity checks are performed during cluster integration.
Changes:
- Update the outbound preflight retry shape from
60 x 5sto20 x 15sinparts/linux/cloud-init/artifacts/cse_main.sh. - Add a ShellSpec assertion to ensure the outbound preflight uses the intended retry parameters.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| parts/linux/cloud-init/artifacts/cse_main.sh | Adjusts outbound connectivity preflight retry/timeout parameters to allow DNS fallback within an attempt. |
| spec/parts/linux/cloud-init/artifacts/cse_main_spec.sh | Adds a test that validates the retry parameters embedded in cse_main.sh. |
cameronmeissner
approved these changes
Jul 20, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 8618f8d1-4a31-43a9-92d7-0ba79b33675f
| fi | ||
| else | ||
| logs_to_events "AKS.CSE.apiserverCurl" "retrycmd_if_failure ${API_SERVER_CONN_RETRIES} 1 10 curl -v --cacert /etc/kubernetes/certs/ca.crt https://${API_SERVER_NAME}:443" || time curl -v --cacert /etc/kubernetes/certs/ca.crt "https://${API_SERVER_NAME}:443" || VALIDATION_ERR=$ERR_K8S_API_SERVER_CONN_FAIL | ||
| logs_to_events "AKS.CSE.apiserverCurl" "retrycmd_if_failure ${API_SERVER_CONN_RETRIES} 1 15 curl -v --cacert /etc/kubernetes/certs/ca.crt https://${API_SERVER_NAME}:443" || time curl -v --cacert /etc/kubernetes/certs/ca.crt "https://${API_SERVER_NAME}:443" || VALIDATION_ERR=$ERR_K8S_API_SERVER_CONN_FAIL |
Contributor
Author
There was a problem hiding this comment.
Existing behaviour. I have no willpower to change it
cameronmeissner
approved these changes
Jul 20, 2026
cameronmeissner
approved these changes
Jul 20, 2026
r2k1
enabled auto-merge (squash)
July 20, 2026 23:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
The Linux CSE wraps hostname-based connectivity checks with per-attempt timeouts. With multiple custom DNS servers, an unresponsive primary can consume the timeout before libc tries a responsive secondary.
This gives both affected checks 15 seconds per attempt while preserving or reducing their total retry budgets:
Each attempt can now cover the normal primary DNS timeout, secondary DNS fallback, and TCP/TLS setup. The rendered endpoints and failure behavior are unchanged.
Tests:
spec/parts/linux/cloud-init/artifacts/cse_main_spec.shGENERATE_TEST_DATA=true go test ./pkg/agent...cse_main.shWhich issue(s) this PR fixes:
N/A