Hey there, today, we’re diving into the world of containerization and cloud deployment with a simple yet powerful tutorial on how to deploy a Hello World app on Google Kubernetes Engine (GKE). This is a simple guide for beginners. Let’s start…
At first, Enable the Kubernetes Engine API,
then go to GKE cluster interface. Click Create button.
Under Cluster basics, do the following:
In the Name field, enter the following name: hello-world-cluster
Please remember the Region that you selected, at the end of the step, you need to use it.
Keep the default values for the rest of the settings and click Create button to start creating the cluster.
In the Google Cloud console, go to the GKE Workloads page. Click Create deployment
Leave Existing container image selected, and in Image path enter the following path:
us-docker.pkg.dev/google-samples/containers/gke/hello-app:1.0
then click Continue button
In Deployment name, enter the following name: hello-world-app
In Kubernetes Cluster, select hello-world-cluster. Click Continue.
In the Expose section, create a load balancing Kubernetes Service to direct external requests to your app:
- Select Expose deployment as a new service.
- Leave Port 1 set to
80
. - In Target port 1, enter
8080
. - Click Deploy.
GKE automatically assigns an available external IP address to the Service. This Service is considered to be part of the hello-world-app workload.
Wait until the deployment completes and you see the Deployment details page. To view a live demo of the hello-world-app workload, click Next.
In the Endpoints column, click the IP address, which is publicly available. GKE opens a new browser tab and sends a request to your app. Dismiss any secure-site warnings, and you should see Hello, world! in the new browser tab.
Congratulations! 👍
Toutes nos félicitations! 👍
Don’t forget to clean up your resources when you’re done to avoid unnecessary charges.
You can operate the Google Cloud Console interface, to delete the cluster by clicking the checkbox and clicking the delete button.
or you can delete the cluster by commandline. According to your config, you should set the zone value, then run the commandline.
gcloud container clusters delete hello-world-cluster --zone=us-central1-a