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
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.
DOCKER_IMAGE_TAG: ‘’ #:v1
- echo ‘in echo vars’
# - echo $KUBE_URL
# - echo $KUBE_TOKEN
# - echo $KUBE_NAMESPACE
# - echo $KUBECONFIG
# - echo $KUBE_INGRESS_BASE_DOMAIN
- ‘dotnet restore --packages $NUGET_PACKAGES_DIRECTORY’
- ‘dotnet build --no-restore’
- ‘dotnet test --no-restore’
image: docker:latest #image: gitlab/dind
- ‘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’
- kubectl apply -f deployment.yaml
How do I make a Gitlab runner deploy to my Kubernetes cluster instead of executing my container?
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”