Sunday, November 7, 2021

GCP Labs and Learning: Day1

 Google Cloud Basics:


What is Cloud Computing:

On-demand self service

Broad network access

resource pooling

rapid elasticity

measured service


How we got there ?

1. Physical/Colo:  User-configured, managed andmaintained

2.Virtualized: user-configured

3. Serverless:  fully automated

GCP computing architectures:


Computer Engine:  IaaS

Kubernetes Engine: Hybrid

App Engine:  PaaS

Cloud Functions:  Serverless logic

Managed services: automated elastic resources





There are seven categories of Google Cloud services:

  • Compute: A variety of machine types that support any type of workload. The different computing options let you decide how much control you want over operational details and infrastructure.
  • Storage: Data storage and database options for structured or unstructured, relational or nonrelational data.
  • Networking: Services that balance application traffic and provision security rules.
  • Cloud Operations: A suite of cross-cloud logging, monitoring, trace, and other service reliability tools.
  • Tools: Services that help developers manage deployments and application build pipelines.
  • Big Data: Services that allow you to process and analyze large datasets.
  • Artificial Intelligence: A suite of APIs that run specific artificial intelligence and machine learning tasks on Google Cloud.

This link takes you to documentation that covers each of these categories in more detail.



gcloud command line tool guide:    https://cloud.google.com/sdk/gcloud/\\\

Task:  Create a new instance with gcloud


In the Cloud Shell, use gcloud to create a new virtual machine instance from the command line:

gcloud compute instances create gcelab2 --machine-type n1-standard-2 --zone us-central1-f


You can also use SSH to connect to your instance via gcloud. Make sure to add your zone, or omit the --zone flag if you've set the option globally:

gcloud compute ssh gcelab2 --zone us-central1-f

Copied!

root@gcelab:~# gcloud compute instances create gcelab2 --machine-type n1-standard-2 --zone us-central1-fERROR: (gcloud.compute.instances.create) Could not fetch resource: - Request had insufficient authentication scopes.root@gcelab:~# gcloud compute instances create --helproot@gcelab:~# gcloud auth loginYou are running on a Google Compute Engine virtual machine.It is recommended that you use service accounts for authentication.You can run: $ gcloud config set account `ACCOUNT`to switch accounts if necessary.Your credentials may be visible to others with access to thisvirtual machine. Are you sure you want to authenticate withyour personal account?Do you want to continue (Y/n)? YGo to the following link in your browser: https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=32555940559.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&scope=openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fappengine.admin+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcompute+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Faccounts.reauth&state=WdD33GmHNnCFegP97I1UHlZ3SRyt1G&prompt=consent&access_type=offline&code_challenge=5k51PZEpb3Q1iltqKOd6dvQpm39cJUMCyNxzfNdSR4E&code_challenge_method=S256Enter verification code: 4/1AX4XfWj94bCcfIcdkycwAFIFXAm_oXT3w1xEAw6vBGgesKYPp7RWUt0uD2UYou are now logged in as [student-03-ade82501e04b@qwiklabs.net].Your current project is [qwiklabs-gcp-00-ca462a1639c8]. You can change this setting by running: $ gcloud config set project PROJECT_IDroot@gcelab:~# gcloud compute instances create gcelab2 --machine-type n1-standard-2 --zone us-central1-fCreated [https://www.googleapis.com/compute/v1/projects/qwiklabs-gcp-00-ca462a1639c8/zones/us-central1-f/instances/gcelab2].NAME ZONE MACHINE_TYPE PREEMPTIBLE INTERNAL_IP EXTERNAL_IP STATUSgcelab2 us-central1-f n1-standard-2 10.128.0.3 34.72.124.161 RUNNING

Got into a authentication error on first attempt of creating instance using gcloud. The error is displayed above and solved as well. For more information about solution refere this:

https://stackoverflow.com/questions/49584800/error-gcloud-compute-ssh-could-not-fetch-resource-insufficient-permission






No comments:

Post a Comment