Site Tools


gcp

GCP commands

Firest, install the client : https://cloud.google.com/sdk/docs/install-sdk

GCP commands CheatSheet

gcloud init

gcloud auth list
gcloud auth login
gcloud auth application-default list  # used by Terraform

gcloud config configurations list
gcloud config configurations activate <wanted-config>

gcloud config set project <prj-id>
gcloud projects list
gcloud config get-value project

# connect to gcr
gcloud auth configure-docker

# list storages
gsutil ls

# list compute instances
gcloud compute addresses list

# list available services
gcloud services list --available

GKE cluster

GKE doc : https://cloud.google.com/kubernetes-engine

gcloud components install gke-gcloud-auth-plugin

# Create a GKE cluster
gcloud container clusters create gke1 --num-nodes=1 --region europe-west1 --project=PROJECT_ID
# or, with autopilot
gcloud container clusters create-auto gke1 --region europe-west1 --project=PROJECT_ID



# Get the kubeconfig file
gcloud container clusters get-credentials gke1 --region=europe-west1

# delete the cluster
gcloud container clusters delete gke1 --region europe-west1 --project=infra-jdxlabs
gcp.txt · Last modified: 2023/01/14 12:17 by jdx