{"id":20140189,"url":"https://github.com/czantoine/deploying-apps-to-google-cloud","last_synced_at":"2026-06-09T15:02:01.549Z","repository":{"id":140681768,"uuid":"450779154","full_name":"czantoine/Deploying-Apps-to-Google-Cloud","owner":"czantoine","description":null,"archived":false,"fork":false,"pushed_at":"2022-01-22T10:02:44.000Z","size":82,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-02T23:26:08.590Z","etag":null,"topics":["devops","gcp","kubernetes","pipeline"],"latest_commit_sha":null,"homepage":"","language":null,"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/czantoine.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-22T10:02:23.000Z","updated_at":"2022-02-10T21:50:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"9d112e3a-384b-4503-80d2-fdd6f1f9d4b7","html_url":"https://github.com/czantoine/Deploying-Apps-to-Google-Cloud","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/czantoine/Deploying-Apps-to-Google-Cloud","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czantoine%2FDeploying-Apps-to-Google-Cloud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czantoine%2FDeploying-Apps-to-Google-Cloud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czantoine%2FDeploying-Apps-to-Google-Cloud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czantoine%2FDeploying-Apps-to-Google-Cloud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/czantoine","download_url":"https://codeload.github.com/czantoine/Deploying-Apps-to-Google-Cloud/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/czantoine%2FDeploying-Apps-to-Google-Cloud/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34112225,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["devops","gcp","kubernetes","pipeline"],"created_at":"2024-11-13T21:49:40.636Z","updated_at":"2026-06-09T15:02:01.544Z","avatar_url":"https://github.com/czantoine.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# DevOps Pipeline Google Cloud \n\nDeploy applications to the Google Cloud services App Engine, Kubernetes Engine, and Cloud Run.\n\n![Project](img/project.png)\n\n## Download a app from GitHub\n\n\nActivate Cloud Shell \n\n``` shell\nmkdir gcp-course\ncd gcp-course\ngit clone https://GitHub.com/GoogleCloudPlatform/training-data-analyst.git\ncd training-data-analyst/courses/design-process/deploying-apps-to-gcp\nsudo pip3 install -r requirements.txt\npython3 main.py\n```\n\nGo to Web Preview, on port 8080\n\n## Deploy to App Engine\n\nCreate new file app.yaml\n\n\n``` shell\ncd gcp-course/training-data-analyst/courses/design-process/deploying-apps-to-gcp\necho \"runtime: python37\" \u003e app.yaml\n```\n\nApp Engine application has to be created\n\n``` shell\ngcloud app create --region=us-central\ngcloud app deploy --version=one --quiet\n```\n\nNavigation menu, click App Engine \u003e Dashboard. In the upper-right corner of the dashboard is a link to your application.\n\nClick on the link to test your program. Make a change to the program to see how easy the App Engine makes managing versions.\n\n\nEdit file main.py\n\n``` shell\ncd training-data-analyst/courses/design-process/deploying-apps-to-gcp\n```\n\n``` python\n model = {\"title\": \"Hello App Engine.\"}\n ```\n\nNow deploy version two\n\n``` shell\ngcloud app deploy --version=two --no-promote --quiet\n```\n\nYou should see again \" Hello GCP \". This is because of the --no-promote parameter in the previous command.\n\nGo to the Versions tab. Notice that two versions are listed.\n\nClick on the version two link to test it. It should return \"Hello App Engine\".\n\nTo migrate production traffic to version two, click Split Traffic at the top. Change the version to two, and click Save. Give it a minute to complete. Refresh the browser tab that earlier returned Hello GCP. It should now return the new version.\n\n## Deploy to Kubernetes Engine\n\nIn the Navigation Menu, click Kubernetes Engine. If a message appears saying the Kubernetes API is being initialized, wait for it to complete.\n\nClick Create\n\nCreate Cluster dialog box, to the right of the GKE Standard option, click Configure.\n\nClick the three dots to the right of the cluster and then click Connect.\n\nIn the Connect to the cluster screen, click Run in Cloud Shell. This opens Cloud Shell with the connect command entered automatically.\n\nPress Enter to connect to the cluster\n\n``` shell\n kubectl get nodes\n```\n\n``` terminal\nNAME                                       STATUS   ROLES    AGE   VERSION\ngke-cluster-1-default-pool-ad7ed400-9kw8   Ready    \u003cnone\u003e   66s   v1.21.5-gke.1302\ngke-cluster-1-default-pool-ad7ed400-vxbv   Ready    \u003cnone\u003e   67s   v1.21.5-gke.1302\ngke-cluster-1-default-pool-ad7ed400-w2g4   Ready    \u003cnone\u003e   66s   v1.21.5-gke.1302\n```\n\nEdit file main.py\n\n``` shell\ncd training-data-analyst/courses/design-process/deploying-apps-to-gcp\n```\n\n``` python\n model = {\"title\": \"Hello Kubernetes Engine.\"}\n ```\n\nCreate a new file kubernetes-config.yaml in the training-data-analyst/courses/design-process/deploying-apps-to-gcp folder \n\n```\ncd training-data-analyst/courses/design-process/deploying-apps-to-gcp\nvi kubernetes-config.yaml\n```\n\nThe content of this file is on my repo\n\nBuild a Docker image\n\n``` shel\ncd ~/gcp-course/training-data-analyst/courses/design-process/deploying-apps-to-gcp\ngcloud builds submit --tag gcr.io/$DEVSHELL_PROJECT_ID/devops-image:v0.2 .\n```\n\nThe image name is in the form gcr.io/project-id/devops-image:v0.2\n\nHighlight your image name and copy it to the clipboard. Paste that value in the kubernetes-config.yaml file, overwriting the string \u003cYOUR IMAGE PATH HERE\u003e.\n\nFor me : \u003cimage : gcr.io/qwiklabs-gcp-03-225efe339fd2/devops-image:v0.2\u003e\n\nEnter the following Kubernetes command to deploy your application:\n\n``` shell\nkubectl apply -f kubernetes-config.yaml\n```\n\n``` terminal\ndeployment.apps/devops-deployment created\nservice/devops-deployment-lb created\n```\n``` shell \nkubectl get pods\n```\n\n``` terminal\nNAME                                 READY   STATUS    RESTARTS   AGE\ndevops-deployment-58c988b696-lzclc   1/1     Running   0          48s\ndevops-deployment-58c988b696-rdhhh   1/1     Running   0          48s\ndevops-deployment-58c988b696-stfpd   1/1     Running   0          48s\n```\n\nA load balancer was also added in the configuration file. Type the following command to see whether it was created:\n\n``` shell \nkubectl get services\n```\n\n``` terminal\nNAME                   TYPE           CLUSTER-IP    EXTERNAL-IP       PORT(S)        AGE\ndevops-deployment-lb   LoadBalancer   10.8.10.193   104.197.126.143   80:31232/TCP   75s\nkubernetes             ClusterIP      10.8.0.1      \u003cnone\u003e            443/TCP        7m57s\n``\n\nWhen you have an external IP, open a browser tab and make a request to it. It should return Hello Kubernetes Engine. It might take a few seconds to be ready.\n\nIn your favorite web browser go to 104.197.126.143\n\n## Deploy to Cloud Run\n\nEdit main.py \n\n``` python\n model = {\"title\": \"Hello Cloud Run.\"}\n ```\n\nCloud Run, you need to build a Docker image. In Cloud Shell, enter the following commands to use Cloud Build to create the image and store it in Container Registry:\n\n``` shell\ncd ~/gcp-course/training-data-analyst/courses/design-process/deploying-apps-to-gcp\ngcloud builds submit --tag gcr.io/$DEVSHELL_PROJECT_ID/cloud-run-image:v0.1 .\n```\n\nClick Create service. This enables the Cloud Run API.\n\nIn Configure how this service is triggered, select Allow unauthenticated invocations\n\nIn Service name, type hello-cloud-run.\n\nAccept the defaults in the Deployment platform section and click next.\n\nClick the Select link in the Container image URL text box. In the resulting dialog, expand cloud-run-image and select the image listed. Then click Select.\n\nIn Autoscaling set the Maximum number of instances to 6. Leave the rest as defaults.\n\nFinally, click Create.\n\nIt shouldn't take long for the service to deploy. When a green check appears, click on the URL that is automatically generated for the application. It should return Hello Cloud Run.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fczantoine%2Fdeploying-apps-to-google-cloud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fczantoine%2Fdeploying-apps-to-google-cloud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fczantoine%2Fdeploying-apps-to-google-cloud/lists"}