How to Use GCP Cloud Shell Effectively

      Comments Off on How to Use GCP Cloud Shell Effectively

Google Cloud Platform is one of the popular and fast-growing Cloud platforms. In this article, we will discuss about Google Cloud Shell Web Interface. Also, we will see how Cloud Shell is useful to manage cloud resources in the proper way.

Introduction:

Google Cloud Shell is an interactive shell environment for Google Cloud Platform that makes it easy for us to learn and experiment with GCP and manage your projects and resources from your web browser.

Google Cloud Shell will be useful if you are,

  • A DevOps Engineer who wants to execute Gcloud commands to manage some resources without activating account in his system terminal.
  • A DevOps Engineer who does not want to authenticate to his personal account from the system terminal to avoid accidental executions.
  • An engineer who works on non-Linux/Unix distro and does not want to have Command-Line feather enabled on your laptop.
  • A developer who does not want to have Gcloud CLI installed in your system to perform basic operations in google cloud.

What does it bring to the table:

  • Provisions a temporary VM with,
    1. Google Cloud SDK and other tools preinstalled
    2. Supports most of the higher level programming languages.
    3. 5GB persistent disk storage.
    4. Build In Code Editor and Terminal.
  • Provides easy access to Google Cloud resources based on the user access rights.
  • Single click activation and deactivation of Shell from the Web UI.
  • Various options to customise the shell environment.

Note: Google Cloud Shell has a limit of 50hrs per week usuage.

How to launch the Google Cloud Shell:

Google has made it very easy to activate any time from the web UI. The Activate Cloud Shell option resides at the top right toolbar section always like shown in the image. Image was taken from Google Documentation

Starting a Cloud Shell session

Using the Cloud Shell Terminal:

  • We can open multiple new shell terminals in the same Cloud SHell window by pressing the + sign near to the project name.
  • You can access terminal of multiple projects at the same Cloud Shell which is a good thing.
  • Once Cloud Shell is activated you could see all required gcloud binaries in the terminal.
  • Google Cloud Shell has a quota limit of 50hrs per week which will be sufficient for most of its users.
  • Copy and Paste will work simply by using Ctrl+C and Ctrl+V.
  • Simply we can upload and download files into Cloud Shell from our local or from GCS Bucket or VMs to avoid interruption while file transfer.
  • Terminal Restart option is provided to reboot the cloud shell VM if it is not responsive.

Adjusting the Display Window:

  • Click the Hide Hide Shell Button Shell Button and Restore Restore Shell Button Shell Button buttons to hide and restore the session display.
  • Click on the close terminal X sign to close the terminal window.
  • Click the Settings button Settings Button and then Switch to Light Theme or Switch to Dark Theme to toggle between themes.
  • We can change the terminal settings like we use in linux using the terminal preferences.

Build In Code Editor:

The built-in code editor provides the convenience of viewing and editing files in the same environment where projects are built and deployed.

Cloud Shell Editor allows us easily modify files on CSR, to do so, navigate to your Cloud Source Repository, and select a repository of choice. Click on Edit Code at the Top-Right Corner of the page

Refer to the guide on using the code editor for more details.

Interesting Article About Shrinking Persistent Disk is here

Sharing is caring!

About DINESH SC

I'm an IT professional having multiple years of experience in IT Infrastructure planning, System integrations, Project implementation, and delivery. DevOps Enthusiast skilled with broad ranges of technology adoption. Well versed with Cloud Computing and Application Service Offerings such as SaaS/PaaS/IaaS. Expert in aligning business goals, mission and process to architect innovative solutions and strategies.