I am trying to create a ci pipeline. Gitlab is running in one of our clusters and I have another 2 clusters for dev and production.
Here is a part of my gitlab.ci.yml file:
- gcloud auth activate-service-account --key-file ~/gcloud-service-key.json --project $DEV_PROJECT
- gcloud config set project $DEV_PROJECT
- gcloud config set container/cluster eu-west
- gcloud config set compute/zone europe-west3-b
- gcloud container clusters get-credentials eu-west --zone europe-west3-b --project $DEV_PROJECT
- sh scripts/prepare.sh $SERVICE_NAME $DEV_PROJECT $CI_BUILD_REF $URL_PREFIX
- kubectl get pods
- kubectl apply -f k8s/kubernetes-deploy.yaml
Unfortunately the context does not change and gitlab tries to deploy to the cluster, where gitlab is installed and not the other.
So, how can I fix this? Do I need to enable the kubernetes integration and install the gitlab runner?
(already gave that a shot, but I am having some issues the rbac enabled)
Any help would be really appreciated!