Skip to content

GoogleCloudPlatform/gke-poc-toolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Repository files navigation

GKE PoC Toolkit

release stars license

logo

The GKE Proof of Concept (PoC) Toolkit is a demo generator for Google Kubernetes Engine.

demo-gif

Quickstart

  1. Create a Google Cloud Project and connect it to an existing Billing account.
  2. Open a bash-compatible shell (eg. Google Cloud Shell) and ensure you have the following tools installed:
  1. Set your Project ID environment variable and operating system.
export PROJECT_ID=<your-project-id>
export OS="darwin" # choice of darwin or amd64 
  1. Set up local authentication to your project.
gcloud config set project $PROJECT_ID
gcloud auth login
gcloud auth application-default login
  1. Download the GKE PoC Toolkit binary.
mkdir gke-poc-toolkit && cd "$_"
VERSION=$(curl -s https://api.github.com/repos/GoogleCloudPlatform/gke-poc-toolkit/releases/latest | grep browser_download_url | cut -d "/" -f 8 | tail -1)
curl -sLSf -o ./gkekitctl https://github.com/GoogleCloudPlatform/gke-poc-toolkit/releases/download/${VERSION}/gkekitctl-${OS} && chmod +x ./gkekitctl
  1. Initialize the cli:
./gkekitctl init
  1. Run gkekitctl apply to run the Toolkit. By default, this command sets up a single-cluster GKE environment. (Configuration here). Enter your project ID when prompted.
./gkekitctl apply
# expected output 
INFO[0000] 鈽革笍 ----- GKE POC TOOLKIT ----- 馃洜
INFO[0000] Enter your Google Cloud Project ID:

This command takes about 10 minutes to run; when it completes, you will have a full GKE demo environment ready to explore and deploy applications to.

# Expected output on successful run 
Apply complete! Resources: 61 added, 0 changed, 0 destroyed.
time="2022-02-04T21:57:59Z" level=info msg="馃攧 Finishing ACM install..."
time="2022-02-04T21:57:59Z" level=info msg="鈽革笍 Generating Kubeconfig..."
time="2022-02-04T21:57:59Z" level=info msg="Clusters Project ID is gpt-e2etest-020422-214428"
time="2022-02-04T21:58:00Z" level=info msg="Connecting to cluster: gke_gpt-e2etest-020422-214428_us-central1_gke-central,"
time="2022-02-04T21:58:00Z" level=info msg="鉁旓笍 Kubeconfig generated: &{Kind:Config APIVersion:v1 Preferences:{Colors:false Extensions:map[]} Clusters:map[gke_gpt-e2etest-020422-214428_us-central1_gke-central:0xc000844900] AuthInfos:map[gke_gpt-e2etest-020422-214428_us-central1_gke-central:0xc0008a23c0] Contexts:map[gke_gpt-e2etest-020422-214428_us-central1_gke-central:0xc0012bad20] CurrentContext: Extensions:map[]}"
time="2022-02-04T21:58:00Z" level=info msg="鈽革笍  Verifying Kubernetes API access for all clusters..."
time="2022-02-04T21:58:00Z" level=info msg="馃寧 5 Namespaces found in cluster=gke_gpt-e2etest-020422-214428_us-central1_gke-central"

Update

If you want to update your environment change the config file and re-run the apply command. This is a great way to add or remove clusters.

## Local tf state 
./gkekitctl apply --config <"config file name">

## If you are using remote TF state 
./gkekitctl apply --config <"config file name"> --gkestate <"bucket name used for state file"> --vpcstate <"if using sharevpc, bucket name for shared vpc state file">

Clean up

./gkekitctl delete

Learn More