<p>I'm struggling to get an app deployed to GKE using Helm Charts and Gitlab Auto Devops. I feel like I've made lots of progress, but I've reached something I can't seem to figure out.</p>

<p>I only have two stages right now, "build" and "production". During the "production" stage it fails after deploying to Kubernetes with the message <code>Error from server (NotFound): deployments.extensions "production" not found</code>. I've looked at similar SO questions but can't seem to match up their solutions with my environment. I'm new to the whole kubernetes thing and am doing my best to piece things together, solving one problem at a time...and there have been a lot of problems!</p>

<p>Here is my <code>deployment.yml</code> file. I used kompose to get started with Helm charts.</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  annotations:
    kompose.cmd: kompose convert -c
    kompose.version: 1.19.0 ()
  creationTimestamp: null
  labels:
    io.kompose.service: api
  name: api
spec:
  replicas: 1
  strategy:
    type: Recreate
  template:
    metadata:
      namespace: {{ .Release.Namespace }}
      annotations:
        kompose.cmd: kompose convert -c
        kompose.version: 1.19.0 ()
      creationTimestamp: null
      labels:
        io.kompose.service: api
    spec:
      imagePullSecrets:
        - name: gitlab-registry
      containers:
      - image: git.company.com/company/inventory-api
        name: api
        env:
          - name: RAILS_ENV
            value: "production"
        ports:
        - containerPort: 5000
        resources: {}
        volumeMounts:
        - mountPath: /app
          name: api-claim0
      restartPolicy: Always
      volumes:
      - name: api-claim0
        persistentVolumeClaim:
          claimName: api-claim0
status: {}
</code></pre>

<p>I found <a href="https://forum.gitlab.com/t/error-from-server-notfound-deployments-extensions-not-found/29301" rel="nofollow noreferrer">this</a> thread that had the same problem and was able to finally figure out how to get it to work for me.</p>

<p>The name of the deployment in the root level metadata had to be changed from "api" to match the deployment environment in Gitlab. In my case I had to change it to "production" and then it deployed without errors. </p>
