Skip to content

Akmazad/GCP-commands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 

Repository files navigation

GCP-commands Essentials for Ubuntu users

Installation

On UBUNTU/Debian:

1. Add the Cloud SDK distribution URI as a package source:

echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list

2. Import the Google Cloud public key:

curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -

3. Update and install the Cloud SDK:

sudo apt-get update && sudo apt-get install google-cloud-sdk

4. Optionally, install any of these additional components:

google-cloud-sdk-app-engine-python
google-cloud-sdk-app-engine-python-extras
google-cloud-sdk-app-engine-java
google-cloud-sdk-app-engine-go
google-cloud-sdk-bigtable-emulator
google-cloud-sdk-cbt
google-cloud-sdk-cloud-build-local
google-cloud-sdk-datalab
google-cloud-sdk-datastore-emulator
google-cloud-sdk-firestore-emulator
google-cloud-sdk-pubsub-emulator
kubectl

5. Run gcloud init to start:

gcloud init

Configuration

See default configuration setting

compact list

gcloud config list

detailed list

gcloud config list --all

list all the projects

gcloud projects list

change a config settings (e.g. set a current project to a project, namely 'HelloGCPWorld' with ID as 'hellogcpworld')

gcloud config set project hellogcpworld 

see all the list of regions

gcloud redis zones list

This may generate a prompt like

API [redis.googleapis.com] not enabled on project [897975539982]. 
Would you like to enable and retry (this will take a few minutes)? 
(y/N)

chose Y.

set the zone for the current project

gcloud config set compute/zone asia-east1-b

disable prompt

gcloud config set disable_prompts true

set up a proxy (type, address and port)

gcloud config set proxy/type http
gcloud config set proxy/address 127.0.0.0
gcloud config set proxy/port 8080

Using GCP CLIs (e.g. gsutil, bq, and gcloud)

see the credentiated account

gcloud auth list

to set the active account

gcloud config set account `ACCOUNT`

see any command group under a CLI (e.g. gcloud)

gcloud ai models --help
gcloud ai models

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages