Gitlab runner executes container instead of deploying it

Problem
It seems that my Gitlab runner “executes” my container instead of moving it to my Kubernetes cluster.
I believe that is the case since the deployment hangs forever and displays:

Now listening on port :80

Which is what the container (hello world asp.net core app) does when I run it on my computer

Context

I have created a Kubernetes cluster on GCP.
I have linked it in my Gitlab account with a token. I installed Helm tiller from the apps. I installed ingress from the apps and Gitlab runner as well.

When I do kubectl get deployments --all-namespaces, I see a Gitlab runner deployed.
However, in the Gitlab /settings/ci_cd page, I do not have anything under Specific Runners. I had two runners, and tried to delete them and re-hit the install runner button, but it didn’t help and didn’t add my new runner under the Specific Runners section.

Relevant code


.gitlab-ci.yml

stages:

  • echovars
  • build
  • test
  • containerize
  • deploy

variables:
OBJECTS_DIRECTORY: ‘obj’
NUGET_PACKAGES_DIRECTORY: ‘.nuget’
SOURCE_CODE_PATH: ‘./Bridge’
DOCKER_REGISTRY: ‘registry.gitlab.com/xxx/yyy
DOCKER_IMAGE_TAG: ‘’ #:v1
ACCESS_TOKEN: ‘myaccesstoken’
DOCKER_TLS_CERTDIR: “”

cache:
key: “$CI_JOB_STAGE-$CI_COMMIT_REF_SLUG”
paths:
- ‘$SOURCE_CODE_PATH$OBJECTS_DIRECTORY/project.assets.json’
- ‘$SOURCE_CODE_PATH$OBJECTS_DIRECTORY/.csproj.nuget.
- ‘$NUGET_PACKAGES_DIRECTORY’
policy: pull-push

jobEcho:
stage: echovars
script:
- echo ‘in echo vars’
# - echo $KUBE_URL
# - echo $KUBE_TOKEN
# - echo $KUBE_NAMESPACE
# - echo $KUBECONFIG
# - echo $KUBE_INGRESS_BASE_DOMAIN

jobBuild:
stage: build
image: mcr.microsoft.com/dotnet/core/sdk:3.0

before_script:
- ‘dotnet restore --packages $NUGET_PACKAGES_DIRECTORY’

script:
- ‘dotnet build --no-restore’

jobTests:
stage: test
image: mcr.microsoft.com/dotnet/core/sdk:3.0
script:
- ‘dotnet test --no-restore’

jobContainerize:
stage: containerize
image: docker:latest #image: gitlab/dind
services:
- docker:dind
script:
- ‘echo $CI_PROJECT_PATH_SLUG’
- ‘docker build -t $DOCKER_REGISTRY$DOCKER_IMAGE_TAG -f ./yyy/Dockerfile .’
- ‘docker login -u myusername -p $ACCESS_TOKEN $DOCKER_REGISTRY’
- ‘docker push $DOCKER_REGISTRY’

jobDeploy:
stage: deploy
image: $DOCKER_REGISTRY$DOCKER_IMAGE_TAG
environment:
name: production
url: http://www.mydomain.com/
script:
- kubectl apply -f deployment.yaml

Question

How do I make a Gitlab runner deploy to my Kubernetes cluster instead of executing my container?

Other comments
Everything seems to work fine until the stage deploy.

It seems from Youtube videos that kubectl apply is the instruction that should be executing what I have in deployment.yaml, which should move my container to my cluster on gcp and start it.

I have no file to specify how my runner is configured, as it seems that would be necessary for a manually installed runner, i.e., a runner not installed by clicking on the button “install runner”