A Kubernetes cluster provides compute, storage, networking, and other services for applications, similar to a virtual data center. Apps and their associated services that run in Kubernetes are called workloads.
This tutorial lets you quickly see a running Google Kubernetes Engine cluster and sample workload, all set up using the Google Cloud console. You can then explore the workload in the Google Cloud console before going on to our more in-depth learning path, or to start planning and creating your own production-ready cluster.
If you'd prefer to set up your sample cluster and workload by using Terraform, see Create a cluster with Terraform.
To follow step-by-step guidance for this task directly in the Google Cloud console, click Guide me:
Before you begin Take the following steps to enable the Kubernetes Engine API:Verify that billing is enabled for your Google Cloud project.
Make sure that you have the following role or roles on the project: Compute Admin, Kubernetes Engine Admin, Service Account User
Check for the rolesIn the Google Cloud console, go to the IAM page.
Go to IAMIn the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.
In the Google Cloud console, go to the IAM page.
Go to IAMIn the New principals field, enter your user identifier. This is typically the email address for a Google Account.
In Autopilot mode, Google manages your cluster configuration, including scaling, security, and other preconfigured settings. Clusters in Autopilot mode are optimized to run most production workloads and provision compute resources based on your Kubernetes manifests.
In the Google Cloud console, go to the GKE Create an Autopilot cluster page.
Under Cluster basics, do the following:
In the Name field, enter the following name:
hello-world-cluster
Keep the default values for the rest of the settings and click Create to start creating the cluster.
When you're redirected to the Kubernetes clusters page, click hello-world-cluster in the Name column.
You can watch the progress of your cluster as it is being configured, deployed, and verified.
Wait until you see a check mark next to the hello-world-cluster page title.
Deploy a sample "hello world" web app provided by Google and stored as a container in Artifact Registry.
In the Google Cloud console, go to the GKE Workloads page.
Click Deploy .
In Deployment name, enter the following name:
hello-world-app
In Kubernetes Cluster , select hello-world-cluster.
Click Next: Container details
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
This simple "hello world" app is packaged into a single container, but larger apps typically consist of several related containers that can be deployed together and run as a single workload.
Click Next: Expose (optional)
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.
For Autopilot clusters, you might see an error message, such as Does not have minimum availability
. This occurs because Autopilot deletes and then re-creates the nodes. Wait a few minutes, then click refresh Refresh to update the page.
Wait until the deployment completes and you see the Deployment details page.
In the Google Cloud console, go to the Deployment details page for hello-world-app:
In the Google Cloud console, go to the GKE Workloads page.
In the Name column, click the name of the workload you deployed, hello-world-app.
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.
If Endpoints is empty, your organization might have a policy that prevents external access.
You have successfully created a GKE cluster in Autopilot mode and deployed a sample workload.
Clean up to avoid billing chargesIf you plan to take additional tutorials or to explore your sample further, wait until you're finished to perform this cleanup step. You can continue to use the sample Kubernetes cluster in most GKE tutorials.
If you created a new project to learn about GKE and you no longer need the project, delete the project.
If you used an existing GKE project, delete the resources you created to avoid incurring charges to your account:
Go to the GKE Clusters page.
Select the row containing hello-world-cluster, and click Delete .
In the Delete hello-world-cluster window, do the following:
In the hello-world-cluster field, enter hello-world-cluster
.
Click Delete.
If you receive an error message about the cluster being repaired, you can wait for the process to complete, and then delete the cluster. This operation might take some time to complete.
If you created a logs sink and bucket when following instructions in other tutorials:
Go to the Cloud Logging Logs storage page.
Select hello-world-cluster-bucket and click Delete.
Go to the Logging Log router page.
Select hello-world-cluster-sink and click Delete.
Explore your cluster and workload to learn about the some of the key workload settings and resources that you deployed.
Try our more in-depth Learning path: Scalable apps.
Learn how to get started with real life cluster administration in our Cluster administration overview.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4