0

I have this Deployment:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: app-deployment
spec:
  replicas: 2
  template:
    metadata:
      labels:
        app: app
    spec:
      containers:
      - name: app
        image: 172.20.34.206:5000/myapp_img:1.0
        ports:
    - containerPort: 8080

Now, I want to upgrade the image from 1.0 to 2.0, so I do this:

$ kubectl patch deployment app-deployment -p '{"spec":{"containers":[{"name":"myapp","image":"172.20.34.206:5000/myapp_img:2.0"}]}}'

But I get this error:

Error from server: the server rejected our request for an unknown reason (patch deployments.extensions app-deployment)

If I edit the Deployment via kubectl edit deployment/app-deployment, it works properly.

Héctor
  • 24,444
  • 35
  • 132
  • 243
  • Does adding `-v` (and possibly another integer right after it to increase verbosity level) give you details? – Timo Reimann Apr 29 '16 at 14:08
  • Couldn't repro on HEAD (what's 2.0, did you mean kube 1.2?). Note that your yaml is wrong, "containerPort" is a field in the list of ports. – Prashanth B Apr 29 '16 at 17:26
  • @PrashanthB: 2.0 is referring to the updated image tag, not the Kubernetes version. – Timo Reimann Apr 29 '16 at 21:54
  • 1
    Please try the (updated) answer I gave in http://stackoverflow.com/a/36924484/420061. If that's not working, please post the output of `kubectl get deployment app-deployment -o yaml`. – Timo Reimann Apr 29 '16 at 22:02
  • @TimoReimann Thanks again, it is working :D – Héctor May 02 '16 at 06:52

0 Answers0