Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pods are not restarted when changing the init container's image #82523

sofat1989 opened this issue Sep 10, 2019 · 2 comments


Copy link

commented Sep 10, 2019

From the doc here,

A user updates the Pod specification, causing the init container image to change. Any changes to the init container image restarts the Pod. App container image changes only restart the app container.

I updated the init container image, we didnt get any changes for these pods.
init containers are not re-executed.

From the logic of computePodActions here, it does not calculate the hash change for the init container.

// Check initialization progress.
	initLastStatus, next, done := findNextInitContainerToRun(pod, podStatus)
	if !done {
		if next != nil {
			initFailed := initLastStatus != nil && isInitContainerFailed(initLastStatus)
			if initFailed && !shouldRestartOnFailure(pod) {
				changes.KillPod = true
			} else {
				// Always try to stop containers in unknown state first.
				if initLastStatus != nil && initLastStatus.State == kubecontainer.ContainerStateUnknown {
					changes.ContainersToKill[initLastStatus.ID] = containerToKillInfo{
						name:      next.Name,
						container: next,
						message: fmt.Sprintf("Init container is in %q state, try killing it before restart",
				changes.NextInitContainerToStart = next
		// Initialization failed or still in progress. Skip inspecting non-init
		// containers.
		return changes

/sig node


This comment has been minimized.

Copy link

commented Sep 11, 2019



This comment has been minimized.

Copy link

commented Sep 12, 2019

@sofat1989 did you test this with deployment or statefulset or with a plain pod yaml ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
4 participants
You can’t perform that action at this time.