mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-19 17:16:12 +00:00
migrate --register-with-taints to KubeletConfiguration
This commit is contained in:
@@ -20,6 +20,7 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
v1 "k8s.io/api/core/v1"
|
||||
"k8s.io/klog/v2"
|
||||
"k8s.io/mount-utils"
|
||||
|
||||
@@ -28,7 +29,6 @@ import (
|
||||
internalapi "k8s.io/cri-api/pkg/apis"
|
||||
kubeletapp "k8s.io/kubernetes/cmd/kubelet/app"
|
||||
"k8s.io/kubernetes/cmd/kubelet/app/options"
|
||||
"k8s.io/kubernetes/pkg/apis/core"
|
||||
"k8s.io/kubernetes/pkg/kubelet"
|
||||
kubeletconfig "k8s.io/kubernetes/pkg/kubelet/apis/config"
|
||||
"k8s.io/kubernetes/pkg/kubelet/cadvisor"
|
||||
@@ -143,7 +143,7 @@ type HollowKubletOptions struct {
|
||||
MaxPods int
|
||||
PodsPerCore int
|
||||
NodeLabels map[string]string
|
||||
RegisterWithTaints []core.Taint
|
||||
RegisterWithTaints []v1.Taint
|
||||
}
|
||||
|
||||
// Builds a KubeletConfiguration for the HollowKubelet, ensuring that the
|
||||
@@ -162,9 +162,7 @@ func GetHollowKubeletConfig(opt *HollowKubletOptions) (*options.KubeletFlags, *k
|
||||
f.MaxPerPodContainerCount = 2
|
||||
f.NodeLabels = opt.NodeLabels
|
||||
f.ContainerRuntimeOptions.ContainerRuntime = kubetypes.RemoteContainerRuntime
|
||||
f.RegisterNode = true
|
||||
f.RegisterSchedulable = true
|
||||
f.RegisterWithTaints = opt.RegisterWithTaints
|
||||
f.RemoteImageEndpoint = "unix:///run/containerd/containerd.sock"
|
||||
|
||||
// Config struct
|
||||
@@ -209,6 +207,8 @@ func GetHollowKubeletConfig(opt *HollowKubletOptions) (*options.KubeletFlags, *k
|
||||
c.SerializeImagePulls = true
|
||||
c.SystemCgroups = ""
|
||||
c.ProtectKernelDefaults = false
|
||||
c.RegisterWithTaints = opt.RegisterWithTaints
|
||||
c.RegisterNode = true
|
||||
|
||||
return f, c
|
||||
}
|
||||
|
Reference in New Issue
Block a user