GKE cluster setup
Overview
This section provides instructions for setting up the Google Kubernetes Engine (GKE) for use with the CAST Imaging helm charts installation scripts described in Installation on Google Cloud Platform via GKE.
Setup GCP CLI
- Install
gcloud
CLI, see https://cloud.google.com/sdk/docs/install - Initialize the CLI:
gcloud init
Create cluster
#!/bin/bash
# Set your project ID
PROJECT_ID="your-project-id"
# Set your preferred region or zone
REGION="us-east1"
ZONE="us-east1-b"
# Set your cluster name
CLUSTER_NAME="my-gke-cluster"
# Configure gcloud to use your project
gcloud config set project $PROJECT_ID
# Create the GKE cluster
gcloud container clusters create $CLUSTER_NAME \
--zone=$ZONE \
--num-nodes=2 \
--machine-type=e2-standard-8 \
--disk-type=pd-standard \
--disk-size=100GB \
--enable-autoscaling \
--min-nodes=2 \
--max-nodes=4 \
--scopes=https://www.googleapis.com/auth/cloud-platform \
--addons=HttpLoadBalancing,GcpFilestoreCsiDriver
# Verify cluster creation
gcloud container clusters list
# Get credentials to interact with the cluster
gcloud container clusters get-credentials $CLUSTER_NAME --zone=$ZONE
# Verify nodes
kubectl get nodes
Install kubectl - commandline K8s tool
- Follow the instructions provided here: https://kubernetes.io/docs/tasks/tools/
- Install gke-gcloud-auth-plugin:
gcloud components install gke-gcloud-auth-plugin
- Test the cli is working by running:
kubectl version --short --client
(Linux) orkubectl.exe version --short --client
(Microsoft Windows)
Install Helm
- Follow the instructions provided here: https://helm.sh/docs/intro/quickstart/ . The binary download is provided here: https://github.com/helm/helm/releases