Skip to main content

☁️ GCP - Google Cloud Platform

Google Kubernetes Engine (GKE) is a managed kubernetes offering by GCP.

Prerequisites

Setup

  • Ensure you have hour GCP profile configured. Run gcloud auth login. Refer to the docs for configuration

    • Verify by running gcloud auth list to see that you've successfully logged in.
  • We will create a new GKE cluster k8s-goat-cluster. You can modify the command as you need, run gcloud container clusters create --help to see all available options.

gcloud container clusters create k8s-goat-cluster --location=us-east1
info

This command will create the GKE clusters. The command will exit, once the clusters are created. The whole setup would take 10-15 minutes.

  • Once the cluster is created, you can update your ~/.kube/config file with the following command,
gcloud container clusters get-credentials k8s-goat-cluster --zone us-east1
  • Confirm that the cluster has been added to your config and the right context is set by running kubectl cluster-info.

  • Then clone the Kubernetes Goat repository locally by running the following command

git clone https://github.com/madhuakula/kubernetes-goat.git
  • Navigate to the folder for setup and installation of the Kubernetes Goat
cd kubernetes-goat/
  • Run the following script to set up and deploy the Kubernetes Goat resources into your cluster
bash setup-kubernetes-goat.sh