|
|
Cloud Shell
Author: Venkata Sudhakar
Google Cloud Shell is a free, browser-based interactive shell environment that provides command-line access to your GCP resources directly from the Google Cloud Console. It comes pre-installed with all the tools you need to manage and develop on GCP - including gcloud CLI, kubectl, Terraform, Docker, git, vim, Python, Java, Node.js, and Go - with no local installation required. Cloud Shell provisions a temporary Compute Engine virtual machine running a Debian-based Linux OS with 5 GB of persistent home directory storage. The VM is provisioned per-user and per-session - it is not shared and your home directory persists between sessions even when the VM is recycled. Cloud Shell also includes a built-in web-based code editor powered by Eclipse Theia (similar to VS Code), making it a full development environment accessible entirely from a browser. The below example shows common Cloud Shell commands for managing GCP resources, navigating the environment, and using the built-in tools.
It gives the following output,
[core]
account = [email protected]
project = my-project
PROJECT_ID NAME PROJECT_NUMBER
my-project My Project 123456789
my-other-proj Other Proj 987654321
Google Cloud SDK 460.0.0
kubectl: Client Version: v1.28.0
Terraform v1.6.0
Docker version 24.0.5
Python 3.11.0
The below example shows how to use Cloud Shell to deploy a simple web application to Cloud Run directly from the browser without any local setup.
It gives the following output,
Cloning into cloud-run-hello...
Building and pushing image to gcr.io/my-project/hello-app:v1
Build finished, image pushed.
Deploying container to Cloud Run service [hello-service] in [us-central1]
Service URL: https://hello-service-abc123-uc.a.run.app
Cloud Shell Web Preview: Cloud Shell includes a Web Preview feature that lets you preview web applications running on ports 8080 to 8084 directly in your browser. Click the Web Preview button in the toolbar and select a port to open a proxied URL for your locally running service. This is very useful for testing web servers and APIs during development without deploying them to production.
|
|