Sign inSign up

bmeme/gke-helm-deployer

By bmeme

•Updated 11 months ago

Google Cloud SDK docker image, integrated with Helm, currently being used in Bmeme for CD

Image
0

2.5K

bmeme/gke-helm-deployer repository overview

Maintenance MIT license

⁠GKE HELM DEPLOYER

Google Cloud SDK docker image, based on the official google/cloud-sdk⁠ and integrated with Helm⁠, currently being used in Bmeme for Continuous Deployment.

⁠What is contained in the images

  • Google Cloud SDK (gcloud)
  • Kubectl component enabled
  • Helm
  • A script authenticate that wraps authentication tasks against Google Cloud
  • A script deploy that wraps helm update task

⁠Mandatory environments

Variable NameDescription
GCP_SERVICE_ACCOUNTThe json key of the Google Service Account granted
GCP_PROJECT_IDYour Google Cloud project ID
GKE_CLUSTERThe name of the GKE cluster on which to install the application via Helm.
GKE_ZONEThe zone of the GKE cluster

⁠Scripts

⁠Authentication

Set mandatory enviroments, then:

# /usr/bin/authenticate
⁠Deploy
# /usr/bin/deploy -h

This script facilitates Helm deployment on a Kubernetes cluster.

SYNOPSIS
deploy [-dh] [-a release_name] [-n namespace] [-c chart] [-v chart_version] [-f file]

-a release_name
  Specify the release name. Mandatory.

-n namespace
  Specify the namespace where to install. Mandatory

-c chart_name
  Specify the chart name to install. Mandatory

-v chart_version
  Specific version to install. Optional

-f file
  The absolute/relative path of the values file. Optional

-d
  Execute the helm command with --debug --dryrun

-h
  Display this help

⁠How to use it in a .gitlab-ci.yml pipeline

image: bmeme/gke-helm-deployer:latest

stages:
  - dry_run
  - deploy

variables:
  GCP_PROJECT_ID: my-gcp-project
  GKE_CLUSTER: my-awesome-cluster
  GKE_ZONE: europe-west3-b

before_script:
  - /usr/bin/authenticate
  - helm repo add my-repo https://my-chart-repo.example.com
  - helm repo update

dry_run:
  stage: dry_run
  script:
    - |
      /usr/bin/deploy \
        -a my-app \
        -n my-namespace \
        -c my-repo/my-chart \
        -v 1.0.0 \
        -f ./values.yaml \
        -d

deploy:
  stage: deploy
  script:
    - |
      /usr/bin/deploy \
        -a my-app \
        -n my-namespace \
        -c my-repo/my-chart \
        -v 1.0.0 \
        -f ./values.yaml
    - kubectl rollout status deployment/my-app -n my-namespace

Tag summary

Content type

Image

Digest

sha256:ca51de986…

Size

338.1 MB

Last updated

11 months ago

docker pull bmeme/gke-helm-deployer