{"id":16323755,"url":"https://github.com/shavo007/hello-world","last_synced_at":"2025-05-14T15:12:15.248Z","repository":{"id":41794724,"uuid":"184355528","full_name":"shavo007/hello-world","owner":"shavo007","description":"Cloud run demo","archived":false,"fork":false,"pushed_at":"2022-12-09T21:44:52.000Z","size":210,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-17T04:26:38.430Z","etag":null,"topics":["cloudrun","google"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shavo007.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-01T01:42:51.000Z","updated_at":"2021-05-09T23:45:05.000Z","dependencies_parsed_at":"2023-01-25T16:40:21.007Z","dependency_job_id":null,"html_url":"https://github.com/shavo007/hello-world","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shavo007%2Fhello-world","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shavo007%2Fhello-world/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shavo007%2Fhello-world/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shavo007%2Fhello-world/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shavo007","download_url":"https://codeload.github.com/shavo007/hello-world/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254170067,"owners_count":22026219,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudrun","google"],"created_at":"2024-10-10T22:55:34.824Z","updated_at":"2025-05-14T15:12:15.224Z","avatar_url":"https://github.com/shavo007.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hello World with Cloud Code\n\n![Architecture Diagram](./img/diagram.png)\n\n\"Hello World\" is a simple Kubernetes application that contains a single\n[Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) and a corresponding\n[Service](https://kubernetes.io/docs/concepts/services-networking/service/). The Deployment contains a\nweb server that simply prints \"Hello World\".\n\n----\n\n## Table of Contents\n\n### Cloud Code for Visual Studio Code\n\n1. [Getting Started](#getting-started])\n2. [What's in the box](https://cloud.google.com/code/docs/vscode/quickstart#whats_in_the_box)\n3. Using Cloud Code\n    * [Set up a Google Kubernetes Engine Cluster](https://cloud.google.com/code/docs/vscode/quickstart#creating_a_google_kubernetes_engine_cluster)\n    * [Deploy the app](https://cloud.google.com/code/docs/vscode/quickstart#deploying_your_app)\n    * [Continuous Deployment](https://cloud.google.com/code/docs/vscode/quickstart#initiating_continuous_deployment)\n    * [View Container Logs](https://cloud.google.com/code/docs/vscode/quickstart#viewing_container_logs)\n    * [Debug Your Code](https://cloud.google.com/code/docs/vscode/quickstart#debugging_your_application)\n    * [Open a Terminal in Your Container](https://cloud.google.com/code/docs/vscode/quickstart#opening_a_terminal_in_your_container)\n4. [Using the Command Line](#using-the-command-line)\n    * [Skaffold](#using-skaffold)\n    * [kubectl](#using-kubectl)\n\n----\n\n### Getting Started\n\nThis sample was written to demonstrate how to use the Cloud Code extension for Visual Studio code.\n\n* [Install Cloud Code for VS Code](https://cloud.google.com/code/docs/vscode/install)\n* [Creating a new app](https://cloud.google.com/code/docs/vscode/creating-an-application)\n* [Editing YAML files](https://cloud.google.com/code/docs/vscode/yaml-editing)\n\n----\n\n## Three options\n\n1. Cloud run vanilla\n\n### Containerizing an app and uploading it to Container Registry\n\n```bash\ngcloud builds submit --tag gcr.io/cloud-build-1/helloworld #Build your container image using Cloud Build. The image is stored in Container Registry and can be re-used if desired\n\n```\n\n#### Deploy to cloud run \n\n```bash\ngcloud beta run deploy --image gcr.io/cloud-build-1/helloworld #respond y to allow unauthenticated invocations.\n\n```\n\n\u003e Cloud Run automatically and horizontally scales your container image to handle the received requests, then scales down when demand decreases. You only pay for the CPU, memory, and networking consumed during request handling.\n\n![Cloud Run console](./img/CloudRun.png)\n\n2. Cloud run on GKE with istio and knative\n\n```bash\n\ngcloud beta container clusters create shane-gke \\\n  --addons=HorizontalPodAutoscaling,HttpLoadBalancing,Istio,CloudRun \\\n  --machine-type=n1-standard-4 \\\n  --cluster-version=latest \\\n  --zone=us-central1-a \\\n  --enable-stackdriver-kubernetes --enable-ip-alias \\\n  --scopes cloud-platform\n\ngcloud config set run/cluster [shane-gke]\ngcloud config set run/cluster_location us-central1-a\n\ngcloud beta run deploy --image gcr.io/cloud-build-1/helloworld --cluster shane-gke\n\n#Scroll down to the istio-ingressgateway service and copy the external IP address shown next to the Load Balancer. Ignore the other values.\n\ncurl -H \"Host: helloworld.default.example.com\" [LOAD_BALANCER_IP] #access the service\n\n  ```\n\n  \u003e Note that although these instructions don't enable cluster autoscaling to resize clusters for demand, Cloud Run on GKE automatically scales instances within the cluster.\n\n\n### Using the Command Line\n\nAs an alternative to using the Cloud Code extension, the application can be deployed to a cluster using standard command line tools\n\n#### Skaffold\n\n[Skaffold](https://github.com/GoogleContainerTools/skaffold) is a command line tool that can be used to build, push, and deploy your container images\n\n```bash\nskaffold run --profile cloudbuild -v=debug\n```\n\nCurrently get  an error \n\n```bash\nFATA[0002] build failed: building [gcr.io/cloud-build-1/helloworld]: checking bucket is in correct project: iterating over buckets: Get https://www.googleapis.com/storage/v1/b?alt=json\u0026pageToken=\u0026prefix=cloud-build-1_cloudbuild\u0026project=cloud-build-1\u0026projection=full: oauth2: cannot fetch token: unexpected EOF \n```\n\n\n#### kubectl\n\n[kubectl](https://kubernetes.io/docs/tasks/tools/install-kubectl/) is the official Kubernetes command line tool. It can be used to deploy Kubernetes manifests to your cluster, but images must be build seperately using another tool (for example, using the [Docker CLI](https://docs.docker.com/engine/reference/commandline/cli/))\n\n## Resources\n\n- [Quickstarts](https://cloud.google.com/run/docs/quickstarts)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshavo007%2Fhello-world","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshavo007%2Fhello-world","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshavo007%2Fhello-world/lists"}