<p>I have a node JS app which i am deploying to kubernetes. </p>

<p>I have made changes to node JS app and am redeploying the app to K8s. </p>

<p>However, I notice that the deployment is not making through. </p>

<p>I checked my docker hub and yes the latest image is being deployed. This is my service.yaml file below</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: fourthapp
spec:
  type: LoadBalancer #Exposes the service as a node port
  ports:
  - port: 3000
    protocol: TCP
    targetPort: 3000
  selector:
    app: webapp
</code></pre>

<p>and this is my deploy.yaml file</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: fourthapp
spec:
  replicas: 2
  template:
    metadata:
      labels:
        app: webapp
    spec:
      containers:
      - name: webapp
        image: index.docker.io/leexha/nodejsapp:latest
        ports:
        - containerPort: 3000
        resources:
          requests: 
            memory: 500Mi
            cpu: 0.5
          limits:
            memory: 500Mi
            cpu: 0.5
        imagePullPolicy: Always
</code></pre>

<p>when i run the service.yaml it reads</p>

<pre><code>C:\Users\adrlee\Desktop\oracle\Web_projects&gt;kubectl apply -f service.yml
service "fourthapp" unchanged
</code></pre>

<p>Anything im doing wrong?</p>

Adam
<p>If I understood the question you should update the <em>Deployment</em> instead. The <em>service</em> is just a kind of LB which dispatch traffic between your pods.</p>

<p>First, you should add <code>imagePullPolicy: Always</code> to the deployment to force k8s to download the newest image.</p>

<p>If you want to update the <em>deployment</em> you can run</p>

<p><code>kubectl apply -f deploy.yml
</code></p>

<p>or performing a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#updating-a-deployment" rel="nofollow noreferrer">Rolling Update</a> </p>
