Thursday, July 7, 2022
GCP Linux Mint Ubuntu

Install Google Cloud SDK pada Linux Mint 20 | Ubuntu 20.04

SDK

Install Google Cloud SDK pada Linux Mint 20 | Ubuntu 20.04”

Pengantar

Google cloud SDK adalah seperangkat alat yang memungkinkan Anda mengelola sumber daya yang dihosting di Google Cloud, sama seperti AWS CLI bagi mereka yang menggunakan AWS cloud. Good Cloud SDK menghadirkan sejumlah alat baris perintah penting seperti gcloud, gsutil, dan bq yang memungkinkan pengelolaan aplikasi dan sumber daya lain yang efektif di Google cloud.

Install Google Cloud SDK pada Linux Mint 20 | Ubuntu 20.04

Install Google SDK via repository

sudo apt-get update
sudo apt-get -y upgrade
sudo reboot
  • Cek versi Phyton
$ python --version
3.8.10
  • Jika belum ada phyton install dulu
sudo apt-get install python3
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
  • install dependensi
sudo apt-get install apt-transport-https ca-certificates gnupg
  • Import public key
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
  • Install SDK google cloud
sudo apt-get update
sudo apt-get install google-cloud-sdk
  • Beberapa modul yang bisa di install
oogle-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

Contoh install nya :

sudo apt-get install google-cloud-sdk-app-engine-python

Install Google Cloud SDK via snap

sudo snap install google-cloud-sdk --classic

Install Google Cloud SDK via Tar

#Linux 64bit
wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-347.0.0-linux-x86_64.tar.gz
tar xvf google-cloud-sdk-347.0.0-linux-x86_64.tar.gz

#64-bit arm
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-348.0.0-linux-arm.tar.gz

#32-bit 
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-348.0.0-linux-x86.tar.gz
$ cd google-cloud-sdk
$ ./install.sh
Welcome to the Google Cloud SDK!

To help improve the quality of this product, we collect anonymized usage data
and anonymized stacktraces when crashes are encountered; additional information
is available at <https://cloud.google.com/sdk/usage-statistics>. This data is
handled in accordance with our privacy policy
<https://cloud.google.com/terms/cloud-privacy-notice>. You may choose to opt in this
collection now (by choosing 'Y' at the below prompt), or at any time in the
future by running the following command:

    gcloud config set disable_usage_reporting false

Do you want to help improve the Google Cloud SDK (y/N)?  y


Your current Cloud SDK version is: 347.0.0
The latest available version is: 347.0.0

┌────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│                                                 Components                                                 │
├───────────────┬──────────────────────────────────────────────────────┬──────────────────────────┬──────────┤
│     Status    │                         Name                         │            ID            │   Size   │
├───────────────┼──────────────────────────────────────────────────────┼──────────────────────────┼──────────┤
│ Not Installed │ App Engine Go Extensions                             │ app-engine-go            │  4.9 MiB │
│ Not Installed │ Appctl                                               │ appctl                   │ 21.0 MiB │
│ Not Installed │ Cloud Bigtable Command Line Tool                     │ cbt                      │  7.7 MiB │
│ Not Installed │ Cloud Bigtable Emulator                              │ bigtable                 │  6.6 MiB │
│ Not Installed │ Cloud Datalab Command Line Tool                      │ datalab                  │  < 1 MiB │
│ Not Installed │ Cloud Datastore Emulator                             │ cloud-datastore-emulator │ 18.4 MiB │
│ Not Installed │ Cloud Firestore Emulator                             │ cloud-firestore-emulator │ 40.4 MiB │
│ Not Installed │ Cloud Pub/Sub Emulator                               │ pubsub-emulator          │ 60.4 MiB │
│ Not Installed │ Cloud SQL Proxy                                      │ cloud_sql_proxy          │  7.6 MiB │
│ Not Installed │ Cloud Spanner Emulator                               │ cloud-spanner-emulator   │ 21.8 MiB │
│ Not Installed │ Emulator Reverse Proxy                               │ emulator-reverse-proxy   │ 14.5 MiB │
│ Not Installed │ Google Cloud Build Local Builder                     │ cloud-build-local        │  6.3 MiB │
│ Not Installed │ Google Container Registry's Docker credential helper │ docker-credential-gcr    │  1.8 MiB │
│ Not Installed │ Kustomize                                            │ kustomize                │ 25.9 MiB │
│ Not Installed │ Minikube                                             │ minikube                 │ 25.5 MiB │
│ Not Installed │ Nomos CLI                                            │ nomos                    │ 25.6 MiB │
│ Not Installed │ On-Demand Scanning API extraction helper             │ local-extract            │ 13.6 MiB │
│ Not Installed │ Skaffold                                             │ skaffold                 │ 17.1 MiB │
│ Not Installed │ anthos-auth                                          │ anthos-auth              │ 17.6 MiB │
│ Not Installed │ config-connector                                     │ config-connector         │ 48.7 MiB │
│ Not Installed │ gcloud Alpha Commands                                │ alpha                    │  < 1 MiB │
│ Not Installed │ gcloud Beta Commands                                 │ beta                     │  < 1 MiB │
│ Not Installed │ gcloud app Java Extensions                           │ app-engine-java          │ 52.4 MiB │
│ Not Installed │ gcloud app Python Extensions                         │ app-engine-python        │  7.7 MiB │
│ Not Installed │ gcloud app Python Extensions (Extra Libraries)       │ app-engine-python-extras │ 26.4 MiB │
│ Not Installed │ kpt                                                  │ kpt                      │ 11.7 MiB │
│ Not Installed │ kubectl                                              │ kubectl                  │  < 1 MiB │
│ Not Installed │ kubectl-oidc                                         │ kubectl-oidc             │ 17.6 MiB │
│ Not Installed │ pkg                                                  │ pkg                      │          │
│ Installed     │ BigQuery Command Line Tool                           │ bq                       │  < 1 MiB │
│ Installed     │ Cloud SDK Core Libraries                             │ core                     │ 19.2 MiB │
│ Installed     │ Cloud Storage Command Line Tool                      │ gsutil                   │  3.9 MiB │
└───────────────┴──────────────────────────────────────────────────────┴──────────────────────────┴──────────┘
To install or remove components at your current SDK version [347.0.0], run:
  $ gcloud components install COMPONENT_ID
  $ gcloud components remove COMPONENT_ID

To update your SDK installation to the latest version [347.0.0], run:
  $ gcloud components update


Modify profile to update your $PATH and enable shell command 
completion?

Do you want to continue (Y/n)?  Y

The Google Cloud SDK installer will now prompt you to update an rc 
file to bring the Google Cloud CLIs into your environment.

Enter a path to an rc file to update, or leave blank to use 
[/home/lorna/.bashrc]:  
Backing up [/home/lorna/.bashrc] to [/home/lorna/.bashrc.backup].
[/home/lorna/.bashrc] has been updated.

==> Start a new shell for the changes to take effect.


For more information on how to get started, please visit:
  https://cloud.google.com/sdk/docs/quickstarts

Initialize Google Cloud SDK pada Ubuntu | Linux Mint

$ gcloud init
Welcome! This command will take you through the configuration of gcloud.

Your current configuration has been set to: [default]

You can skip diagnostics next time by using the following flag:
  gcloud init --skip-diagnostics

Network diagnostic detects and fixes local network connection issues.
Checking network connection...done.                                            
Reachability Check passed.
Network diagnostic passed (1/1 checks passed).

You must log in to continue. Would you like to log in (Y/n)? 

Menggunakan Google Cloud SDK pada Ubuntu | Linux Mint

$ gcloud components list

Your current Cloud SDK version is: 347.0.0
The latest available version is: 347.0.0
gcloud auth list
gcloud components install kubectl
gcloud components update

export IMAGE_FAMILY="tf-latest-cu92"
export ZONE="us-west1-b"
export INSTANCE_NAME="my-instance"
export INSTANCE_TYPE="n1-standard-8"

gcloud compute instances create $INSTANCE_NAME \
        --zone=$ZONE \
        --image-family=$IMAGE_FAMILY \
        --image-project=mytestproject \
        --maintenance-policy=TERMINATE \
        --accelerator="type=ndivia-tesla-v100,count=8" \
        --machine-type=$INSTANCE_TYPE \
        --boot-disk-size=100GB \
        --metadata="install-"install-ndivia-driver=True"

gcloud compute instances list 

gcloud compute instances describe <INSTANCE_NAME>

Penutup

Baca Juga :  Cara Install Webmin pada Ubuntu 20.04 / Debian 11

Sahabat Blog Learning & Doing demikianlah penjelasan mengenai Install Google Cloud SDK pada Linux Mint 20 | Ubuntu 20.04 . Semoga Bermanfaat . Sampai ketemu lagi di postingan berikut nya.

(Visited 19 times, 1 visits today)
Klik untuk berbagi dengan orang lain

Similar Posts