<p>I get the following error message in my Gitlab CI pipeline and I can't do anything with it. Yesterday the pipeline still worked, but I didn't change anything in the <em>yml</em> and I don't know where I made the mistake. I also reset my code to the last working commit, but the error still occurs.</p>

<pre><code>$ kubectl set image deployment/ft-backend ft-backend=registry.gitlab.com/projectX/ft-backend
</code></pre>

<blockquote>
  <p>Error from server (NotFound): deployments.extensions "ft-backend" not
  found</p>
</blockquote>

<p><strong>.gitlab-ci.yml</strong></p>

<pre><code>image: docker:latest
services:
  - docker:dind

variables:
  DOCKER_DRIVER: overlay
  SPRING_PROFILES_ACTIVE: gitlab-ci

stages:
  - build
  - package
  - deploy

maven-build:
  image: maven:3-jdk-8
  stage: build
  script: "mvn package -B"
  artifacts:
    paths:
      - target/*.jar

docker-build:
  stage: package
  script:
  - docker build -t registry.gitlab.com/projectX/ft-backend:${CI_COMMIT_SHA} .
  - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.com
  - docker push registry.gitlab.com/projectX/ft-backend:${CI_COMMIT_SHA}

k8s-deploy:
  image: google/cloud-sdk
  stage: deploy
  script:
  - echo "$GOOGLE_KEY" &gt; key.json
  - gcloud auth activate-service-account --key-file key.json
  - gcloud config set compute/zone europe-west3-a
  - gcloud config set project projectX
  - gcloud config unset container/use_client_certificate
  - gcloud container clusters get-credentials development --zone europe-west3-a --project projectX
  - kubectl delete secret registry.gitlab.com
  - kubectl create secret docker-registry registry.gitlab.com --docker-server=https://registry.gitlab.com --docker-username=MY_NAME --docker-password=$REGISTRY_PASSWD --docker-email=MY_MAIL
  - kubectl set image deployment/ft-backend ft-backend=registry.gitlab.com/projectX/ft-backend:${CI_COMMIT_SHA}
  - kubectl apply -f deployment.yml
</code></pre>

laprof
<p>I suppose that when you are invoking command:</p>

<p><code>kubectl set image deployment/ft-backend ft-backend=registry.gitlab.com/projectX/ft-backend</code></p>

<p>deployment <code>ft-backend</code> does not exist in your cluster. Does the command: <code>kubectl get deployment ft-backend</code> return the same result?</p>
