mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 04:06:03 +00:00
kubeadm: pass pod-infra-container-image for all CRs
Pass the flag --pod-infra-container-image to the kubelet not only for Docker but for all CRs. This flag tells the kubelet to special case the image and not garbage collect it.
This commit is contained in:
parent
49e0c4456d
commit
108d1dc56a
@ -79,14 +79,17 @@ func buildKubeletArgMapCommon(opts kubeletFlagsOpts) map[string]string {
|
||||
if opts.nodeRegOpts.CRISocket == constants.DefaultDockerCRISocket {
|
||||
// These flags should only be set when running docker
|
||||
kubeletFlags["network-plugin"] = "cni"
|
||||
if opts.pauseImage != "" {
|
||||
kubeletFlags["pod-infra-container-image"] = opts.pauseImage
|
||||
}
|
||||
} else {
|
||||
kubeletFlags["container-runtime"] = "remote"
|
||||
kubeletFlags["container-runtime-endpoint"] = opts.nodeRegOpts.CRISocket
|
||||
}
|
||||
|
||||
// This flag passes the pod infra container image (e.g. "pause" image) to the kubelet
|
||||
// and prevents its garbage collection
|
||||
if opts.pauseImage != "" {
|
||||
kubeletFlags["pod-infra-container-image"] = opts.pauseImage
|
||||
}
|
||||
|
||||
if opts.registerTaintsUsingFlags && opts.nodeRegOpts.Taints != nil && len(opts.nodeRegOpts.Taints) > 0 {
|
||||
taintStrs := []string{}
|
||||
for _, taint := range opts.nodeRegOpts.Taints {
|
||||
|
Loading…
Reference in New Issue
Block a user