Kumar
Kumar

Reputation: 1

Kubernetes rolling update with different image

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?

Upvotes: 0

Views: 66

Answers (2)

Nitb
Nitb

Reputation: 384

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.

Upvotes: 1

wineinlib
wineinlib

Reputation: 520

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

Upvotes: 1

Related Questions