Skip to content

control-plane: fix kubeadm ops when advertiseAddress cannot be derived from default gateway#13156

Open
clwluvw wants to merge 2 commits intokubernetes-sigs:masterfrom
clwluvw:kubeadm-config
Open

control-plane: fix kubeadm ops when advertiseAddress cannot be derived from default gateway#13156
clwluvw wants to merge 2 commits intokubernetes-sigs:masterfrom
clwluvw:kubeadm-config

Conversation

@clwluvw
Copy link
Copy Markdown
Contributor

@clwluvw clwluvw commented Apr 8, 2026

What type of PR is this?

/kind bug

What this PR does / why we need it:

Fixes kubeadm operations in environments where the API server advertise address cannot be automatically derived from the default gateway (e.g., custom network configurations, multi-homed nodes, or non-standard routing setups).

Does this PR introduce a user-facing change?:

NONE

clwluvw added 2 commits April 8, 2026 20:27
In setups where the advertiseAddress cannot be derived from the
default gateway, setting localAPIEndpoint.advertiseAddress will
eliminate the error caused by that. this is like other kubeadm
configs that we have.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
kubeadm token create subcommand will generate a default config when
nothing as --config is passed. therefore if we have setups that need
the config values to let kubeadm work (like if the ip cannot be derived
by the default gateway) it will fail.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
Copilot AI review requested due to automatic review settings April 8, 2026 18:34
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. labels Apr 8, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: clwluvw
Once this PR has been reviewed and has the lgtm label, please assign tico88612 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested review from ErikJiang and yankay April 8, 2026 18:34
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 8, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @clwluvw. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 8, 2026
Copy link
Copy Markdown

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

This PR aims to make kubeadm-based operations succeed in environments where kubeadm cannot auto-derive the API server advertiseAddress from the default gateway (e.g., non-standard routing / multi-homed nodes), by ensuring kubeadm is given an explicit advertise address via config.

Changes:

  • Pass --config={{ kube_config_dir }}/kubeadm-config.yaml to kubeadm token creation (and token refresh) tasks.
  • Add localAPIEndpoint.advertiseAddress to the kubeadm config used for kubeadm config images list.

Reviewed changes

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

File Description
roles/kubernetes/kubeadm/tasks/main.yml Updates default join token generation to pass a kubeadm config file.
roles/kubernetes/control-plane/tasks/kubeadm-setup.yml Updates control-plane token refresh/default token generation to pass a kubeadm config file.
roles/download/templates/kubeadm-images.yaml.j2 Adds explicit advertiseAddress to the kubeadm config used for deriving required images.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread roles/kubernetes/kubeadm/tasks/main.yml
Comment thread roles/kubernetes/control-plane/tasks/kubeadm-setup.yml
Comment thread roles/kubernetes/control-plane/tasks/kubeadm-setup.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants