control-plane: fix kubeadm ops when advertiseAddress cannot be derived from default gateway#13156
control-plane: fix kubeadm ops when advertiseAddress cannot be derived from default gateway#13156clwluvw wants to merge 2 commits intokubernetes-sigs:masterfrom
Conversation
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>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: clwluvw The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
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 Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
There was a problem hiding this comment.
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.yamlto kubeadm token creation (and token refresh) tasks. - Add
localAPIEndpoint.advertiseAddressto the kubeadm config used forkubeadm 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.
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?: