{"id":32710,"date":"2021-01-18T12:08:53","date_gmt":"2021-01-18T12:08:53","guid":{"rendered":"https:\/\/www.testpreptraining.com\/tutorial\/?page_id=32710"},"modified":"2021-01-18T12:08:54","modified_gmt":"2021-01-18T12:08:54","slug":"google-cloud-shell","status":"publish","type":"page","link":"https:\/\/www.testpreptraining.ai\/tutorial\/google-cloud-shell\/","title":{"rendered":"Google Cloud Shell"},"content":{"rendered":"\n<p><strong><a href=\"https:\/\/www.testpreptraining.ai\/tutorial\/google-certified-professional-cloud-architect\/\" target=\"_blank\" rel=\"noreferrer noopener\">Go back to GCP Tutorials<\/a><\/strong><\/p>\n\n\n\n<p>Google Cloud Shell is an interactive shell environment for Google Cloud that makes it easy for you to learn and experiment with Google Cloud and manage your projects and resources from your web browser.<\/p>\n\n\n\n<p>With Cloud Shell, the Cloud SDK gcloud command-line tool and other utilities you need are pre-installed, fully authenticated, up-to-date, and always available when you need them. Additionally, Cloud Shell comes with a built-in code editor with an integrated Cloud Code experience, allowing you to develop, build, debug, and deploy your cloud-native apps entirely in the Cloud. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Running gcloud commands with Cloud Shell<\/strong><\/h4>\n\n\n\n<p>Cloud Shell comes with Cloud SDK pre-installed. This means you can run gcloud commands without additional setup. You can run gcloud command-line tool commands, like gcloud help straight away after activating a Cloud Shell session. Additionally, any time you manage resources using the interactive interface from the Console, you can generate the equivalent gcloud command and run it in Cloud Shell. However, if you fill in the details of your required resource during tasks like the creation of an instance group or a Kubernetes cluster, the generated command will contain the correct flags and their values.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\"><strong>Example: Creating a Compute Engine instance with a generated gcloud command<\/strong><\/h6>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, go to the Compute Engine > VM instances page.<\/li><li>Secondly, click Create.<\/li><li>Thirdly, fill in the required and optional fields to configure the new instance to suit your needs.<\/li><li>Then, below the Create button, you&#8217;ll find the option to generate the equivalent REST or gcloud command. Click on command line to see the suggested gcloud command.<\/li><li>Next, click Run in Cloud Shell.<\/li><li>After that, press Enter to execute the command once you see it at the prompt.<\/li><li>Going back to the VM instances page, you&#8217;ll see the newly created and running VM instance.<\/li><li>Lastly, delete the instance either from the command line or the VM instances page, if you no longer need it, to avoid incurring unnecessary charges.<\/li><\/ul>\n\n\n\n<h4 class=\"wp-block-heading\"><strong>Running a Kubernetes Engine application with Cloud Code<\/strong><\/h4>\n\n\n\n<p>You&#8217;ll set up a new Kubernetes application using a starter &#8216;Hello World&#8217; template, build and test the app locally, create a Google Kubernetes Engine cluster, run your app on this cluster, debug your running code, and view your live application.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Creating an application<\/strong><\/h5>\n\n\n\n<ul class=\"wp-block-list\"><li>Firstly, directly launch the Cloud Shell Editor.<\/li><li>Secondly, from the Cloud Code status bar, select New Application.<\/li><li>Thirdly, choose &#8216;Kubernetes application&#8217; as your preferred application type.<\/li><li>Then, from the list of templates (Node.js, Python (Flask and Django frameworks), Java, Go), choose a Hello World app in a language of your choosing.<ul><li>For example, choosing to Go: Hello World will create a starter Go Hello World app.<\/li><\/ul><\/li><li>Lastly, select a folder as your application location to proceed and click &#8216;Create New Application&#8217;.<ul><li>Cloud Shell Editor loads the application in a new workspace. Once reloaded, your app is accessible in the explorer view.<\/li><\/ul><\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.testpreptraining.ai\/google-cloud-certified-professional-cloud-architect-free-practice-test\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"117\" src=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2021\/01\/Google-Certified-Professional-Cloud-Architect-prac-tests-750x117.png\" alt=\"gcp cloud architect practice tests\" class=\"wp-image-31460\" srcset=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2021\/01\/Google-Certified-Professional-Cloud-Architect-prac-tests-750x117.png 750w, https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2021\/01\/Google-Certified-Professional-Cloud-Architect-prac-tests.png 961w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/a><\/figure><\/div>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Testing your application locally<\/strong><\/h5>\n\n\n\n<p>To run your application in a local Kubernetes cluster in Cloud Shell, follow these steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>In your terminal, run the following command:<ul><li><em>minikube start<\/em><\/li><\/ul><\/li><li>When your minikube cluster is ready, click on the Cloud Code status bar and select Run on Kubernetes. Confirm that you want to use the minikube context.<\/li><li>If prompted, authorize Cloud Shell to make Google Cloud API calls.<\/li><li>As your app is being built, you can monitor its progress in the Output Panel. Once it&#8217;s built, you can launch the app with the link displayed in your Output panel.<\/li><\/ul>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Editing your application<\/strong><\/h5>\n\n\n\n<p>To edit your application, follow these steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>With the Explorer view, find the main.go file under cmd > hello-world folder.<\/li><li>Modify &#8220;Hello, world!&#8221; to a message of your choosing.<\/li><li>Once you make this change, you&#8217;ll notice your app being rebuilt by the logs in your Output panel.<\/li><li>When your app finishes building and deploying, launch it from the link in your Output panel to view your updated application.<\/li><\/ul>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Viewing application logs<\/strong><\/h5>\n\n\n\n<p>To analyze your application while it&#8217;s running, you can access its logs using the Log Viewer:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Launch the Log Viewer by typing &#8220;Cloud Code: View Logs&#8221; using the Command Palette (accessible with Ctrl\/Cmd+Shift+P).<\/li><li>This view allows you to filter and navigate the logs for your app.<\/li><li>Select &#8216;Deployment&#8217; or &#8216;Pod&#8217; to see the logs for your app.<\/li><li>Refresh your app in the browser, and see the new logs generated by clicking the Logs refresh button.<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/www.testpreptraining.ai\/google-cloud-certified-professional-cloud-architect-practice-exam\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"117\" src=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2021\/01\/Google-Certified-Professional-Cloud-Architect-online-course-750x117.png\" alt=\"Google Cloud Shell GCP cloud architect  online course\" class=\"wp-image-31461\" srcset=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2021\/01\/Google-Certified-Professional-Cloud-Architect-online-course-750x117.png 750w, https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2021\/01\/Google-Certified-Professional-Cloud-Architect-online-course.png 961w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/a><\/figure><\/div>\n\n\n\n<p><strong>Reference:<\/strong> <a href=\"https:\/\/cloud.google.com\/shell\/docs\/running-a-kubernetes-engine-app\" target=\"_blank\" rel=\"noreferrer noopener\">Google Documentation<\/a><\/p>\n\n\n\n<p><strong><a href=\"https:\/\/www.testpreptraining.ai\/tutorial\/google-certified-professional-cloud-architect\/\" target=\"_blank\" rel=\"noreferrer noopener\">Go back to GCP Tutorials<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Go back to GCP Tutorials Google Cloud Shell is an interactive shell environment for Google Cloud that makes it easy for you to learn and experiment with Google Cloud and manage your projects and resources from your web browser. With Cloud Shell, the Cloud SDK gcloud command-line tool and other utilities you need are pre-installed,&#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-32710","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Google Cloud Shell - Testprep Training Online Tutorial<\/title>\n<meta name=\"description\" content=\"Enhance your knowledge about Google Cloud Shell using the Google Certified Professional Cloud Architect Online Course and Tutorial Now!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.testpreptraining.ai\/tutorial\/google-cloud-shell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Google Cloud Shell - Testprep Training Online Tutorial\" \/>\n<meta property=\"og:description\" content=\"Enhance your knowledge about Google Cloud Shell using the Google Certified Professional Cloud Architect Online Course and Tutorial Now!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/google-cloud-shell\/\" \/>\n<meta property=\"og:site_name\" content=\"Testprep Training Tutorials\" \/>\n<meta property=\"article:modified_time\" content=\"2021-01-18T12:08:54+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2021\/01\/Google-Certified-Professional-Cloud-Architect-prac-tests-750x117.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/google-cloud-shell\/\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/google-cloud-shell\/\",\"name\":\"Google Cloud Shell - Testprep Training Online Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\"},\"datePublished\":\"2021-01-18T12:08:53+00:00\",\"dateModified\":\"2021-01-18T12:08:54+00:00\",\"description\":\"Enhance your knowledge about Google Cloud Shell using the Google Certified Professional Cloud Architect Online Course and Tutorial Now!\",\"breadcrumb\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/google-cloud-shell\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.testpreptraining.ai\/tutorial\/google-cloud-shell\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/google-cloud-shell\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Google Cloud Shell\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#website\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"name\":\"Testprep Training Tutorials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#organization\",\"name\":\"Testprep Training\",\"url\":\"https:\/\/www.testpreptraining.ai\/tutorial\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"contentUrl\":\"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png\",\"width\":583,\"height\":153,\"caption\":\"Testprep Training\"},\"image\":{\"@id\":\"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Google Cloud Shell - Testprep Training Online Tutorial","description":"Enhance your knowledge about Google Cloud Shell using the Google Certified Professional Cloud Architect Online Course and Tutorial Now!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.testpreptraining.ai\/tutorial\/google-cloud-shell\/","og_locale":"en_US","og_type":"article","og_title":"Google Cloud Shell - Testprep Training Online Tutorial","og_description":"Enhance your knowledge about Google Cloud Shell using the Google Certified Professional Cloud Architect Online Course and Tutorial Now!","og_url":"https:\/\/www.testpreptraining.ai\/tutorial\/google-cloud-shell\/","og_site_name":"Testprep Training Tutorials","article_modified_time":"2021-01-18T12:08:54+00:00","og_image":[{"url":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-content\/uploads\/2021\/01\/Google-Certified-Professional-Cloud-Architect-prac-tests-750x117.png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/google-cloud-shell\/","url":"https:\/\/www.testpreptraining.ai\/tutorial\/google-cloud-shell\/","name":"Google Cloud Shell - Testprep Training Online Tutorial","isPartOf":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website"},"datePublished":"2021-01-18T12:08:53+00:00","dateModified":"2021-01-18T12:08:54+00:00","description":"Enhance your knowledge about Google Cloud Shell using the Google Certified Professional Cloud Architect Online Course and Tutorial Now!","breadcrumb":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/google-cloud-shell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.testpreptraining.ai\/tutorial\/google-cloud-shell\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/google-cloud-shell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.testpreptraining.ai\/tutorial\/"},{"@type":"ListItem","position":2,"name":"Google Cloud Shell"}]},{"@type":"WebSite","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#website","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","name":"Testprep Training Tutorials","description":"","publisher":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.testpreptraining.ai\/tutorial\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#organization","name":"Testprep Training","url":"https:\/\/www.testpreptraining.ai\/tutorial\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/","url":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","contentUrl":"https:\/\/www.testpreptraining.com\/tutorial\/wp-content\/uploads\/2020\/07\/tpt-logo-6.png","width":583,"height":153,"caption":"Testprep Training"},"image":{"@id":"https:\/\/www.testpreptraining.ai\/tutorial\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/32710","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/comments?post=32710"}],"version-history":[{"count":6,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/32710\/revisions"}],"predecessor-version":[{"id":32941,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/pages\/32710\/revisions\/32941"}],"wp:attachment":[{"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/media?parent=32710"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/categories?post=32710"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testpreptraining.ai\/tutorial\/wp-json\/wp\/v2\/tags?post=32710"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}