Loving Still
Loving Still

Reputation: 13

How to update deployment's initContainer image without down time in kubernetes?

kubernetes version:1.10.4

In my project,I have an initContainer image and an common container image,I want to update the initContainer's image with zero down time.

But the kubectl set image xxx command cannot work on initContainer.

I have read the document about rolling update containers' image, but not found the information about initContainer image.

Who has encountered this situation?

Upvotes: 1

Views: 758

Answers (1)

If you want to do manual change I'd start with

kubectl edit deployment xxx

for non-interactive operations it's probably easiest to use kubectl patch like

kubectl patch deployment/xxx -p '{"spec": {"template": {"spec": {"initContainers":[{"name":"cinit", "image":"alpine:3.6"}]}}}}'

Upvotes: 1

Related Questions