Kubernetes rolling update with different image

6/11/2018

Suppose my deployment is having mysql:5.6 image . Is it possible (does kubernetes support) to do rolling update for my deployment with image nginx:1.14.0?

-- Kumar
kubernetes

2 Answers

6/18/2018

Answer to your question is yes. I have tried that on dev and staging servers. What you are asking for is container name changing in addition to the version. In fact, you can change the entire url to fetch the image from.

-- Nitb
Source: StackOverflow

6/11/2018

It is possible only if the deployment doesn't rely on specific image (use content of specific image). For example, use the following yaml. But I don't think there's such scenarios in practice.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-demo
  labels:
    app: demo
spec:
  selector:
    matchLabels:
      run: demo
  replicas: 3
  template:
    metadata:
      labels:
        run: demo
    spec:
      containers:
      - name: demo
        image: mysql:5.6
        imagePullPolicy: IfNotPresent
-- wineinlib
Source: StackOverflow