Control Plane
Self-hosting a DevZero Control Plane on GCP GKE.
By following this guide, you'll set up the Control Plane software in a region hosted on GCP Google Kubernetes Engine (GKE), enabling you to:
- Deploy an GKE cluster configured for seamless DevZero integration.
- Launch self-hosted DevZero Workspaces and Kubernetes Clusters to kickstart your development projects.
- Manage and scale your infrastructure directly on GCP with ease.
This step-by-step guide will walk you through creating a GCP GKE cluster, deploying DevZero Helm charts, and integrating your setup with the DevZero dashboard allowing your team to quickly start building in a production-like environment.
Let's get started!
Hosting the DevZero Control Plane on GCP GKE
For a detailed overview of the DevZero Control Plane, click here
Modules Overview
1. GCP
The control plane can be deployed on GCP infrastructure, leveraging services like:
-
Google Kubernetes Engine (GKE) for Kubernetes orchestration.
-
Cloud SQL for database management.
-
Cloud Storage for persistent storage.
-
IAM (Identity and Access Management) for fine-grained access control.
2. GKE (Google Kubernetes Engine)
-
Cluster Management: Deploy the control plane using Helm charts or Terraform modules on GKE.
-
Node Groups: Configure scaling policies and node templates to optimize performance and cost.
-
Monitoring: Integrate with Prometheus and Grafana for detailed insights.
3. VPC (Virtual Private Cloud)
-
Configure private and public subnets for secure traffic routing.
-
Set up Cloud NAT, Internet Gateways, and route tables for proper networking.
4. Autoscaler
-
Manage workloads efficiently using Horizontal Pod Autoscalers (HPA) and Cluster Autoscalers.
-
Enable resource scaling based on CPU/memory usage.
5. Filestore
-
Provide shared, persistent storage for stateful workloads within the control plane using Filestore.
-
Optimize cost and performance by utilizing storage tiers effectively.
6. DevZero CLI
-
Cluster Interaction: Manage control plane components with commands like devzero start or kubectl integration.
-
Configuration Management: Update or debug settings using CLI commands.
-
Add-ons: Install additional components via devzero addons list.
Prerequisites
Checkout out the Checklist Page to make sure you have the required permissions in GCP to set up the Control Plane.
Setting up Control Plane on the self-hosted Cluster
Configuring gcloud CLI to interact with your GCP account locally
First, run this GCP command to obtain new credentials:
Your browser will open to connect to GCP, and then you will get this message:
You are now logged in as your-GCP-account-email.
You can change your current project by running:
Replace the PROJECT-ID
placeholder with your current GCP project ID.
You may get this error message, and you should enter Y
:
WARNING: Your active project does not match the quota project in your local Application Default Credentials file. This might result in unexpected quota issues.
To update your Application Default Credentials quota project, use the following command.
You might encounter the following on your first run:
Type Y
, and you will see:
Next, run this command to verify your GCP project:
Setting up the Infrastructure
Clone this repository which contains all the Terraform configuration to set up the infrastructure.
Run cd self-hosted-tf/examples/gcp/control-and-data-plane
to get into the directory.
Then, run this to install all the required Providers.
Run this to create all the GCP resources such as VPC, GKE, Filestore, Autoscaler, etc.
Kubeconfig set up
Set up your local kubeconfig to connect to the GKE cluster:
Download Credentials of your Service Account
Go to IAM & Admin > Service Accounts in the GCP Console. Click Vault-Service-Account
which is created with the terraform. Go to the KEYS tab and click ADD KEY:
Click Create new key and select JSON key type to download the key in the JSON format as credentials.json.
Create Secret in the GKE Cluster
Create a generic secret in the GKE Cluster which will be used to access the Vault-Service-Account
Deploying the Helm Charts
Helm Registry Credentials
Contact the DevZero team at support@devzero.io to get the helm registry credentials.
Setting up CRDs
Install the CRDs which are prerequisites to set up a DevZero Control Plane on the GKE cluster.
Set up your Route 53 Domain
Ignore this step if you already have a domain. But if you don't have one, register a domain on AWS Route 53.
Install Helm Charts
Download values.yaml from here and install the helm charts to set up the DevZero control plane.
Create new Records in Route 53
Create an A record and add the address of your ingress service in the value. Set the record name as *
:
Create another A record keeping the Subdomain empty. Add the address of your ingress service in the value:
Visit the DevZero Dashboard
Go to <your-dz-control-plane-web-host>/dashboard
to check out the DevZero UI.
Setting up Data Plane on a self-hosted GKE cluster
To set up the data plane in self-hosted environment, follow the guide for Setting up the Data Plane in GCP GKE.