How to install Google Cloud SDK on MacBook pro.
Install Google Cloud SDK on macbookpro
Once installed we can interact with command line tools gcloud ,bq,gsutil,kubectl ,Google Cloud Resources like GCE BigQuery, GCS, and GKE like all products and services we can create and also use for automation scripts.
Run the following command in your terminal.
curl https://sdk.cloud.google.com | bash
Follow the instructions with the below screenshots
Press Enter to run >Y>Y
To verify the install gcloud gcsutil and bq
gcloud version command
biswanathgiri@192 ~ % gcloud versionGoogle Cloud SDK 408.0.1bq 2.0.81core 2022.11.01gcloud-crc32c 1.0.0gsutil 5.16biswanathgiri@192 ~ %
Install additional components, for e.g.
kubectl
biswanathgiri@192 ~ % gcloud components install kubectlYour current Google Cloud CLI version is: 408.0.1
Installing components from version: 408.0.1┌─────────────────────────────────────────────┐
│ These components will be installed. │
├────────────────────────┬─────────┬──────────┤
│ Name │ Version │ Size │
├────────────────────────┼─────────┼──────────┤
│ gke-gcloud-auth-plugin │ 0.4.0 │ 7.1 MiB │
│ kubectl │ 1.22.14 │ 78.5 MiB │
│ kubectl │ 1.22.14 │ < 1 MiB │
└────────────────────────┴─────────┴──────────┘For the latest full release notes, please visit:
https://cloud.google.com/sdk/release_notesDo you want to continue (Y/n)? y╔════════════════════════════════════════════════════════════╗
╠═ Creating update staging area ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Installing: gke-gcloud-auth-plugin ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Installing: gke-gcloud-auth-plugin ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Installing: kubectl ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Installing: kubectl ═╣
╠════════════════════════════════════════════════════════════╣
╠═ Creating backup and activating new installation ═╣
╚════════════════════════════════════════════════════════════╝Performing post processing steps...done.Update done!biswanathgiri@192 ~ %
Initialize Google Cloud SDK
Now to interact with GCP services, we must initialize SDK and setup authentication.
1. Initialize the SDK.
$> gcloud init
2. Follow the below steps to initialize the GCP project along with login access id
biswanathgiri@192 ~ % gcloud init
Welcome! This command will take you through the configuration of gcloud.Settings from your current configuration [default] are:
core:
account: gcpspecialist2020@gmail.com
disable_usage_reporting: 'false'
project: lithe-breaker-363402Pick configuration to use:
[1] Re-initialize this configuration [default] with new settings
[2] Create a new configuration
Please enter your numeric choice: 1Your current configuration has been set to: [default]You can skip diagnostics next time by using the following flag:
gcloud init --skip-diagnosticsNetwork diagnostic detects and fixes local network connection issues.
Checking network connection...done.
Reachability Check passed.
Network diagnostic passed (1/1 checks passed).Choose the account you would like to use to perform operations for this configuration:
[1] gcpspecialist2020@gmail.com
[2] student-02-22bf3634514b@qwiklabs.net
[3] Log in with a new accountPlease enter your numeric choice: 1You are logged in as: [gcpspecialist2020@gmail.com].WARNING: Could not store access token in cache: database is locked
WARNING: Could not store access token in cache: database is locked
Pick cloud project to use:
[1] calm-axis-340007
[2] careful-isotope-333911
[3] handy-cache-340008
[4] lithe-breaker-363402
[5] Enter a project ID
[6] Create a new project
Please enter numeric choice or text value (must exactly match list item): 4Your current project has been set to: [lithe-breaker-363402].Not setting default zone/region (this feature makes it easier to use
[gcloud compute] by setting an appropriate default value for the
--zone and --region flag).
See https://cloud.google.com/compute/docs/gcloud-compute section on how to set
default compute region and zone manually. If you would like [gcloud init] to be
able to do this for you the next time you run it, make sure the
Compute Engine API is enabled for your project on the
https://console.developers.google.com/apis page.Your Google Cloud SDK is configured and ready to use!