Google Cloud CLI: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
sudo apt update
cat <<-'EXE'|sudo bash
sudo apt install apt-transport-https ca-certificates gnupg curl
apt-get update;echo;apt list -a --upgradable
apt-get install -y apt-transport-https ca-certificates gnupg curl
EXE


# register apt-get repository
curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg \
curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg \
| sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg
| sudo tee /etc/apt/keyrings//google-cloud-sdk.asc >/dev/null


cat << EOF | sudo tee /etc/apt/sources.list.d/google-cloud-sdk.list >/dev/null
cat << SRC | sudo tee /etc/apt/sources.list.d/google-cloud-sdk.list >/dev/null
deb [arch=$(dpkg --print-architecture) \
deb [arch=$(dpkg --print-architecture) \
signed-by=/usr/share/keyrings/cloud.google.gpg] \
signed-by=/etc/apt/keyrings/google-cloud-sdk.asc] \
https://packages.cloud.google.com/apt cloud-sdk main
https://packages.cloud.google.com/apt cloud-sdk main
EOF
SRC


sudo apt update
cat <<-'EXE'|sudo bash
sudo apt install google-cloud-cli
apt-get update;echo;apt list -a --upgradable
sudo apt install google-cloud-cli-gke-gcloud-auth-plugin
apt-get install -y google-cloud-cli google-cloud-cli-gke-gcloud-auth-plugin
EXE
</syntaxhighlight>
</syntaxhighlight>



Revision as of 00:15, 24 July 2024

cat <<-'EXE'|sudo bash
apt-get update;echo;apt list -a --upgradable
apt-get install -y apt-transport-https ca-certificates gnupg curl
EXE

curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg \
| sudo tee /etc/apt/keyrings//google-cloud-sdk.asc >/dev/null

cat << SRC | sudo tee /etc/apt/sources.list.d/google-cloud-sdk.list >/dev/null
deb [arch=$(dpkg --print-architecture) \
signed-by=/etc/apt/keyrings/google-cloud-sdk.asc] \
https://packages.cloud.google.com/apt cloud-sdk main
SRC

cat <<-'EXE'|sudo bash
apt-get update;echo;apt list -a --upgradable
apt-get install -y google-cloud-cli google-cloud-cli-gke-gcloud-auth-plugin
EXE

Kontena Lens

gcloud init
gcloud container clusters get-credentials <cluster-name> --zone asia-southeast1 --project <project-name>
gcloud container clusters describe        <cluster-name> --zone asia-southeast1 --format='value(endpoint)'
Lens » Catalog » gke_<project-name>_asia-southeast1_<cluster-name>

Playground

gcloud cheat-sheet
gcloud --help
gcloud init --console-only
gcloud init
gcloud auth login --no-browser
gcloud auth login

gcloud container clusters get-credentials <cluster-name> --region asia-southeast1 --project <project-name>
gcloud container clusters describe        <cluster-name> --region asia-southeast1 --format='value(endpoint)'

gcloud container clusters get-credentials <cluster-name> --zone asia-southeast1 --project <project-name>
gcloud container clusters describe        <cluster-name> --zone asia-southeast1 --format='value(endpoint)'

gcloud auth login --no-launch-browser
ls -lah ~/.config/gcloud/
gcloud config list
gcloud config -h
gcloud auth list
gcloud auth -h
gcloud auth login -h
gcloud init -h
gcloud info
gcloud -h

References