GKE

  • Use cdktf to create gke cluster
  • Quick Start
    gcloud config set project <project name>
    # use console and it gives a string to run gcloud cli
    gcloud container clusters create-auto hello-cluster \
        --location=us-central1
    # updates kubectl config...
    gcloud container clusters get-credentials hello-cluster \
        --location us-central1
  • gke-dev-1
    gcloud beta container --project "gke-dev-392619" \
    clusters create "gke-dev-1" \
    --zone "us-central1-a" \
    --no-enable-basic-auth \
    --cluster-version "1.25.8-gke.1000" \
    --release-channel "stable" \
    --machine-type "g1-small" \
    --image-type "COS_CONTAINERD" \
    --disk-type "pd-balanced" \
    --disk-size "30" \
    --metadata disable-legacy-endpoints=true \
    --scopes "https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write","https://www.googleapis.com/auth/monitoring","https://www.googleapis.com/auth/servicecontrol","https://www.googleapis.com/auth/service.management.readonly","https://www.googleapis.com/auth/trace.append" \
    --num-nodes "1" \
    --logging=SYSTEM,WORKLOAD \
    --monitoring=SYSTEM \
    --enable-ip-alias \
    --network "projects/gke-dev-392619/global/networks/default" \
    --subnetwork "projects/gke-dev-392619/regions/us-central1/subnetworks/default" \
    --no-enable-intra-node-visibility \
    --default-max-pods-per-node "110" \
    --security-posture=standard \
    --workload-vulnerability-scanning=disabled \
    --no-enable-master-authorized-networks \
    --addons HorizontalPodAutoscaling,HttpLoadBalancing,GcePersistentDiskCsiDriver \
    --enable-autoupgrade \
    --enable-autorepair \
    --max-surge-upgrade 1 \
    --max-unavailable-upgrade 0 \
    --no-enable-managed-prometheus \
    --enable-shielded-nodes \
    --node-locations "us-central1-a"