Use Infra as Code to pop a k8S cluster on gcp
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Kubernetes on Google Computing Engine

This project leverages hype tools 😉 (terraform 🏗, ansible 🛠, docker 🐳, ...) to automate the deployment of a 6 vms (3 controllers 👩‍✈️, 3 workers 👷‍) kubernetes cluster on GCE.

How to use 🗺

  • Put your adc.json in the app dir (See Gcloud account for details on this file) .
  • Adapt profile to match your desired region, zone and project
  • Launch ./, it will build a docker image and launch a container with all needed tools
  • In the container, launch ./ and wait for ~10mins
  • And you're done ! 🚀

🚽 When you finish, launch ./ to remove all gce resources.


All versions are set as environment variables in the Dockerfile. You can adapt it if you want to try other versions

Gcloud account

To interact with Gcloud API we use a service account. The adc.json is your service account key file. You can find more infos on how to setup a service account here.


Traefik ingress

  • Go to 13-addons dir: cd 13-addons
  • Launch ./, this will create the cluster role needed for traefik, the traefik daemonset and the firewall rule to enable trafic in


  • Go to 13-addons dir: cd 13-addons
  • Launch ./, this will create the service account used for the dashboard (⚠️ with tihs configuration, the service account is bound to the cluster-admin role)
  • Follow the displayed instructions


  • Go to 14-example dir: cd 14-example
  • Deploy whoami app example: kubectl apply -f whoami.yml

Credits 👍

This work is an automation of kubernetes-the-hard-way