Skip to content

Support kubelet node ip flag configuration#138

Merged
wenxuan0923 merged 2 commits intomainfrom
wenx/node-ip-kubelet
Apr 2, 2026
Merged

Support kubelet node ip flag configuration#138
wenxuan0923 merged 2 commits intomainfrom
wenx/node-ip-kubelet

Conversation

@wenxuan0923
Copy link
Copy Markdown
Collaborator

@wenxuan0923 wenxuan0923 commented Apr 2, 2026

Add support for the --node-ip kubelet flag in the kubelet bootstrapping path, mirroring the existing support already present in the kubeadm component.

The --node-ip kubelet flag tells kubelet which IP address to advertise as the node's primary IP to the Kubernetes control plane.

It's useful when a machine has multiple network interfaces (e.g., a management NIC and a data NIC) and you need to ensure the node registers with the correct IP — the one other pods/nodes should use to reach it. Without it, kubelet picks an IP automatically, which may be the wrong interface.

@wenxuan0923 wenxuan0923 marked this pull request as ready for review April 2, 2026 21:21
Copilot AI review requested due to automatic review settings April 2, 2026 21:21
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

This PR adds support for configuring kubelet’s --node-ip flag in the agent’s kubelet bootstrapping flow, matching the capability already present in the kubeadm component so nodes with multiple NICs can reliably register with the intended primary IP.

Changes:

  • Extend agent configuration (KubeletConfig) with a nodeIP setting.
  • Plumb nodeIP through the bootstrapper into the kubelet component action (StartKubeletServiceSpec.node_ip).
  • Render --node-ip into the kubelet systemd drop-in when configured.

Reviewed changes

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

Show a summary per file
File Description
pkg/config/structs.go Adds nodeIP to the agent’s kubelet configuration struct.
pkg/bootstrapper/components.go Passes configured nodeIP into the kubelet Start action using an optional pointer.
components/kubelet/v20260301/kubelet_service.go Makes node_ip available to the systemd drop-in templating parameters.
components/kubelet/v20260301/assets/20-flex-node-node-config.conf Appends --node-ip to KUBELET_NODE_CONFIG_ARGS when NodeIP is set.
components/kubelet/action.proto Adds node_ip to StartKubeletServiceSpec.
components/kubelet/action.pb.go Regenerates protobuf bindings to include the new field.

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

@wenxuan0923 wenxuan0923 merged commit 7002cf3 into main Apr 2, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants