Copy echo "export CLOUDSDK_PYTHON=$(which python3)" >> ~/.zshrc
source ~/.zshrc
./install.sh
Copy gcloud components install COMPONENT_ID
gcloud components remove COMPONENT_ID
Copy gcloud config set project my-project
Copy gcloud config set compute/region NAME
Copy gcloud config set compute/zone NAME
Copy CLOUDSDK_COMPUTE_REGION=us-central1
CLOUDSDK_COMPUTE_ZONE=us-central1-a
CLOUDSDK_CORE_PROJECT=my-project-123456
CLOUDSDK_CONTAINER_CLUSTER=cluster-1
Copy gcloud config list --format 'value(core.project)'
Copy gcloud config configurations list
Copy gcloud compute --project "proj-id-253611" ssh --zone us-central1-a instance-1
Copy # Make sure you are using the correct account
gcloud config list
# Display instance info
gcloud compute instances describe instance-1 --zone=us-central1-a --project=proj-id-253611gcloud compute instances describe instance-1 --zone=us-central1-a --project=proj-id-253611
# Delete instanace and ALL DISKS
gcloud compute instances delete instance-1 --zone=us-central1-a --project=proj-id-253611 --delete-disks=all
Copy gcloud container clusters get-credentials cluster-1 --zone us-central1-c --project proj-id-253611
Copy git clone \
https://github.com/GoogleCloudPlatform/kubernetes-engine-samples
cd \
kubernetes-engine-samples/hello-app
docker build -t \
gcr.io/united-blend-253611/hello-app:v1 \
$PWD
gcloud docker -- push \
gcr.io/united-blend-253611/hello-app:v1
kubectl create deployment \
hello-app \
--image=gcr.io/united-blend-253611/hello-app:v1
kubectl expose deployment \
hello-app \
--type="LoadBalancer" --port \
8080
kubectl get service hello-app \
--watch
Copy # Create SSH tunnel
gcloud compute ssh your-instance-name --project=your-project-name -- -NL 9022:127.0.0.1:22
# Mount remote folder locally
sshfs -odebug,sshfs_debug,loglevel=debug,ServerAliveInterval=30,IdentityFile=~/.ssh/google_compute_engine your-username@localhost:/remote/folder/path /local/folder/path -p 9022
# Mount local folder remotelly
sshfs -odebug,sshfs_debug,loglevel=debug,ServerAliveInterval=30,IdentityFile=~/.ssh/google_compute_engine /local/folder/path your-username@localhost:/remote/folder/path -p 9022
Copy # Openn SSH tunnel
gcloud compute ssh your-instance --project=your-project -- -NL 9022:127.0.0.1:22
# Rsync from local to remote
rsync --progress --checksum -a -e "ssh -p 9022 -o IdentityFile=~/.ssh/google_compute_engine" /local/path your-user@localhost:/remote/path/