Step-by-Step Guide to Create a Kubernetes Cluster in GCP
Google Kubernetes Engine (GKE) simplifies deploying, managing, and scaling containerized applications using Kubernetes in Google Cloud Platform (GCP). This guide walks you through the step-by-step process of creating a Kubernetes cluster in GCP.
Step-by-Step Guide to Create a Kubernetes Cluster in GCP
1. Login to GCP for creating Kubernetes Cluster in GCP
- To begin, log in to your Google Cloud Platform account.
2. Create a New Project
- Click on “Create Project” in the GCP console.
- Name your project, for example, we will give as
My K8s Project
, and click “Create” to proceed.
3. Select Your Project
- After creating the project, select it from the top-right notification panel to access your new project.
4. Enable Kubernetes Engine API
- In the project, search for “Kubernetes Engine” using the search bar at the top.
- You will need to enable the required APIs. Click “Enable” to activate them.
⚡ Note: This process might take a few minutes.
5. Access the Kubernetes Engine Dashboard
- Once the API is active, the Kubernetes Engine dashboard becomes available.
6. Create a Kubernetes Cluster in GCP
- Navigate to Clusters and click “Create Cluster”.
Important Cluster Setup Details:
- Mode Selection: The default mode is Autopilot.
- Cluster Name: Set the name to
my-cluster
. - Standard Tier: Ensure the Standard Tier option is selected.
- Leave other settings unchanged.
- Click Next to continue and review the settings.
7. Review and Finalize the Cluster Creation
- Carefully review the configuration on the final page.
- Click “Create Cluster” to start the cluster creation process.
- The cluster creation process will begin, and you can monitor it using the notification icon at the top-right corner.
⚡ Note: The process may take a few minutes.
8. Verify Kubernetes Cluster in GCP
- After a few minutes, your
my-cluster
will be ready to use.
9. (Optional) Create a Cluster via Command Line
If you prefer using the CLI, you can create a cluster with this command:
gcloud container clusters create my-cluster --region=<region> --num-nodes=<number-of-nodes>
Replace <region>
and <number-of-nodes>
with your desired values.
Conclusion
Congratulations! You have now created a Kubernetes cluster in GCP using Google Kubernetes Engine. This is the first step in managing and deploying containerized applications.
In our previous blog we have learned How to create Instance Groups in Google cloud
In our next blog post, we will explore how to create and deploy applications in your GKE cluster. Stay tuned!