Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 44 additions & 11 deletions components/kubelet/action.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions components/kubelet/action.proto
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ message StartKubeletServiceSpec {
map<string, string> node_labels = 3;
KubeletConfig kubelet_config = 4;
repeated string register_with_taints = 5;
string node_ip = 6;
}

message StartKubeletServiceStatus {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# You may create a higher-numbered drop-in (e.g. 90-custom-node-config.conf)
# to append or override individual env vars.
[Service]
Environment="KUBELET_NODE_CONFIG_ARGS=--node-labels={{.NodeLabels}} --v={{.Verbosity}} --client-ca-file={{.ClientCAFile}}{{range .ClusterDNS}} --cluster-dns={{.}}{{end}}{{if .RegisterWithTaints}} --register-with-taints={{.RegisterWithTaints}}{{end}}"
Environment="KUBELET_NODE_CONFIG_ARGS=--node-labels={{.NodeLabels}} --v={{.Verbosity}} --client-ca-file={{.ClientCAFile}}{{range .ClusterDNS}} --cluster-dns={{.}}{{end}}{{if .RegisterWithTaints}} --register-with-taints={{.RegisterWithTaints}}{{end}}{{if .NodeIP}} --node-ip={{.NodeIP}}{{end}}"
Environment="KUBELET_TUNING_ARGS=--eviction-hard={{.EvictionHard}} --kube-reserved={{.KubeReserved}} --image-gc-high-threshold={{.ImageGCHighThreshold}} --image-gc-low-threshold={{.ImageGCLowThreshold}} --max-pods={{.MaxPods}}"
1 change: 1 addition & 0 deletions components/kubelet/v20260301/kubelet_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ func (s *startKubeletServiceAction) ensureSystemdUnit(
"ImageGCHighThreshold": kubeletConfig.GetImageGcHighThreshold(),
"ImageGCLowThreshold": kubeletConfig.GetImageGcLowThreshold(),
"MaxPods": kubeletConfig.GetMaxPods(),
"NodeIP": spec.GetNodeIp(),
})
if err != nil {
return err
Expand Down
10 changes: 10 additions & 0 deletions pkg/bootstrapper/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ func ptr[T any](value T) *T {
return &value
}

// ptrOrNil returns nil if value is the zero value for T, otherwise returns a pointer to value.
func ptrOrNil[T comparable](value T) *T {
var zero T
if value == zero {
return nil
}
return &value
}

func componentAction(name string) *api.Metadata {
return api.Metadata_builder{Name: &name}.Build()
}
Expand Down Expand Up @@ -298,6 +307,7 @@ var startKubelet resolveActionFunc[*kubelet.StartKubeletService] = func(
ClusterDns: []string{cfg.Node.Kubelet.DNSServiceIP},
MaxPods: ptr(int32(cfg.Node.MaxPods)),
}.Build(),
NodeIp: ptrOrNil(cfg.Node.Kubelet.NodeIP),
}.Build()

return kubelet.StartKubeletService_builder{
Expand Down
1 change: 1 addition & 0 deletions pkg/config/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ type KubeletConfig struct {
DNSServiceIP string `json:"dnsServiceIP"` // Cluster DNS service IP (default: 10.0.0.10 for AKS)
ServerURL string `json:"serverURL"` // Kubernetes API server URL
CACertData string `json:"caCertData"` // Base64-encoded CA certificate data
NodeIP string `json:"nodeIP"` // IP address to advertise as the node's primary IP (--node-ip kubelet flag)
}

// PathsConfig holds file system paths used by the agent for Kubernetes and CNI configurations.
Expand Down
Loading