Skip to content

Commit

Permalink
Merge pull request #99476 from neolit123/1.21-pass-pod-infra-to-all-cr
Browse files Browse the repository at this point in the history
kubeadm: pass pod-infra-container-image for all CRs
  • Loading branch information
k8s-ci-robot authored Feb 26, 2021
2 parents 49e0c44 + 108d1dc commit 3abeb17
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cmd/kubeadm/app/phases/kubelet/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3abeb17

Please sign in to comment.