<p>I've followed a few guides, and I've got CI set up with Google Container Engine and Google Container Registry. The problem is my updates aren't being applied to the deployment.</p>

<p>So this is my deployment.yml which contains a Kubernetes Service and Deployment:</p>

<pre><code>apiVersion: v1
kind: Service 
metadata:
  name: my_app
  labels:
    app: my_app
spec:
  type: LoadBalancer 
  ports:
    - port: 80
      targetPort: 3000
  selector:
    app: my_app
--- 
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: my_app
spec:
  replicas: 1 
  template: 
    metadata:
      labels:
        app: my_app
    spec:
      containers:
        - name: node 
          image: gcr.io/me/my_app:latest
          ports:
            - containerPort: 3000
          resources:
            requests:
              memory: 100

        - name: phantom
          image: docker.io/wernight/phantomjs:2.1.1
          command: ["phantomjs", "--webdriver=8910", "--web-security=no", "--load-images=false", "--local-to-remote-url-access=yes"]
          ports: 
            - containerPort: 8910
          resources:
            requests:
              memory: 1000
</code></pre>

<p>As part of my CI process I run a script which updates the image in google cloud registry, then runs <code>kubectl apply -f /deploy/deployment.yml</code>. Both tasks succeed, and I'm notified the Deployment and Service has been updated:</p>

<pre><code>2016-09-28T14:37:26.375Zgoogleclouddeploymentservice "my_app" configured
2016-09-28T14:37:27.370Zgoogleclouddeploymentdeployment "my_app" configured
</code></pre>

<p>Since I've included the <code>:latest</code> tag on my image, I thought the image would be <a href="http://kubernetes.io/docs/user-guide/images/#updating-images" rel="nofollow">downloaded each time</a> the deployment is updated. Acccording to the <a href="http://kubernetes.io/docs/user-guide/deployments/#strategy" rel="nofollow">docs</a> a <code>RollingUpdate</code> should also be the default strategy.  </p>

<p>However, when I run my CI script which updates the deployment - the updated image isn't downloaded and the changes aren't applied. What am I missing? I'm assuming that since nothing is changing in <code>deployment.yml</code>, no update is being applied. How do I get Kubernetes to download my updated image and use a <code>RollingUpdate</code> to deploy it?</p>

<p>You can force an update of a deployment by changing any field, such as a label. So in my case, I just added this at the end of my CI script:</p>

<pre><code>kubectl patch deployment fb-video-extraction -p \
  "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}"
</code></pre>
