Requirements
Supported add-ons
- Dashboard: Provides a Kubernetes dashboard UI for the cluster.
- Headlamp: The recommended dashboard for the cluster
- AWS Workload Identity: Allows your pods to assume AWS IAM Roles.
- AWS ECR: Allows pulling images from private ECR registries.
- Local Path Storage: Create PVCs backed by local volumes.
- Logs: Enable logging for pods and cluster auditing.
- Metrics: Enable metrics collections.
Step 1 - Preparing the GCP project
Ensure your GCP project has:- A VPC with a subnet in the desired region
-
Service account withe these roles
Role Description roles/compute.instanceAdmin.v1Instances, instance groups, templates roles/compute.loadBalancerAdminForwarding rules, target pools, addresses roles/compute.storageAdminDisks and snapshots roles/compute.securityAdminFirewall rules roles/compute.networkViewerNetworks/subnets discovery (for validation)
GCP.
Permissions can further be restricted using expressions and limiting the scope of the role. Yet Control Plane must be able
Step 2 - Create a Managed Kubernetes Cluster Using a Manifest File
- Update the manifest below: Modify the following
gcp-mk8s-template.yamlYAML manifest below with actual values. Customize the file as needed.
${PROJECT_ID}, ${NETWORK}, ${SUBNET}, ${SECRET} and ${ZONE}.
- Kubernetes Version: 1.32.9.
- Add-ons: Only the headlamp add-on is enabled
- Node Pool: A single
generalnode pool, scaling on-demand between 1 and 2 nodes. - Server Image: ubuntu/noble-24.04.
-
Create the Cluster: Deploy the
aws-mk8s-examplecluster by applying the manifest.- Console: Apply the
gcp-mk8s-template.yamlfile using thecpln apply >_option in the upper right corner. - CLI: Execute
cpln apply -f gcp-mk8s-template.yaml --org YOUR_ORG_HERE.
- Console: Apply the
Step 3 - Accessing the Cluster
1. Using the Terminal
- Obtain the Cluster’s Kubeconfig File: Execute the command
cpln mk8s kubeconfig gcp-mk8s-example -f /tmp/gcp-mk8s-example-conf. - Access the Cluster with
kubectl: Use the obtained kubeconfig file by runningexport KUBECONFIG=/tmp/gcp-mk8s-example-conffor the current shell session.
2. Using Kubernetes Dashboard
- Navigate to Control Plane Console: Visit the Control Plane Console.
- Access the Dashboard: In the Control Plane Console, navigate to
Kubernetesin the left sidebar panel and click onOpenunderHeadlampfor the clustergcp-mk8s-example.