Created
December 22, 2019 17:46
-
-
Save tvvignesh/e82bc33469320aa198c348336b4890fb to your computer and use it in GitHub Desktop.
Example on running Skaffold with GITLAB CI for Kubernetes in GKE (Make sure you modify it appropriately and set GCP_SERVICE_KEY and GCP_PROD_SERVICE_KEY variable in Gitlab with the service account json value)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
- docker:dind | |
stages: | |
- development | |
- production | |
variables: | |
DOCKER_DRIVER: overlay2 | |
DOCKER_TLS_CERTDIR: '' | |
DOCKER_HOST: tcp://docker:2375 | |
development: | |
image: | |
name: gcr.io/k8s-skaffold/skaffold:latest | |
stage: development | |
script: | |
- echo "$GCP_SERVICE_KEY" > gcloud-service-key.json | |
- gcloud auth activate-service-account --key-file gcloud-service-key.json | |
- gcloud config set project project-dev | |
- gcloud config set compute/zone asia-south1-a | |
- gcloud container clusters get-credentials cluster-dev | |
- kubectl config get-contexts | |
- skaffold run | |
only: | |
- master | |
production: | |
image: | |
name: gcr.io/k8s-skaffold/skaffold:latest | |
stage: production | |
script: | |
- echo "$GCP_PROD_SERVICE_KEY" > gcloud-service-key.json | |
- gcloud auth activate-service-account --key-file gcloud-service-key.json | |
- gcloud config set project project-prod | |
- gcloud config set compute/zone asia-south1-a | |
- gcloud container clusters get-credentials cluster-prod | |
- kubectl config get-contexts | |
- skaffold run -p production | |
only: | |
- production |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment