Overview
This guide walks you through deploying the Kingdom to Google Kubernetes Engine (GKE). Thedev environment configuration can be used as a basis for your deployment.
Prerequisites
Before starting, complete the deployment prerequisites including:- Bazel/Bazelisk installation
- Google Cloud SDK configuration
- kubectl installation
- Terraform installation
Kingdom Components
The Kingdom deployment creates the following Kubernetes resources:Services
Services
gcp-kingdom-data-server(Cluster IP)system-api-server(External LoadBalancer)v2alpha-public-api-server(External LoadBalancer)
Deployments
Deployments
gcp-kingdom-data-server-deploymentsystem-api-server-deploymentv2alpha-public-api-server-deployment
CronJobs
CronJobs
completed-measurements-deletion-cronjobpending-measurements-cancellation-cronjobexchanges-deletion-cronjob
Secrets & ConfigMaps
Secrets & ConfigMaps
certs-and-configs-<hash>(Secret)config-files-<hash>(ConfigMap)
Network Policies
Network Policies
default-deny-network-policykube-dns-network-policygke-network-policy- API server and data server network policies
Deployment Steps
Provision Infrastructure with Terraform
Use the example Terraform configuration to provision Google Cloud resources:Create a Initialize and apply the Terraform configuration:
backend.tf file for state management:backend.tf
The Terraform configuration creates:
- GKE cluster named
kingdom - Cloud Spanner instance (1000 processing units, Enterprise edition)
- KMS key ring for encryption
- External IP addresses for API servers
Build and Push Container Images (Optional)
If not using pre-built release images, build and push images from source:
Using Hybrid Development
Using Hybrid Development
For containerized builds, replace commands:
bazel build→tools/bazel-container buildbazel run→tools/bazel-container-run
Generate Kubernetes Kustomization
Generate the K8s configuration using Bazel:Extract the generated archive to a secure location:
Customize Kubernetes Secret
Prepare certificate and configuration files in
~/kingdom-deployment/src/main/k8s/dev/kingdom_secret/:Required Files:-
all_root_certs.pem- TLS trusted root CA store- Concatenation of root certificates for all entities:
- All Duchies
- All EDPs
- All MC reporting tools
- Kingdom itself
- Concatenation of root certificates for all entities:
-
kingdom_root.pem- Kingdom’s root CA certificate -
kingdom_tls.pem- Kingdom’s TLS certificate -
kingdom_tls.key- Private key for Kingdom’s TLS certificate -
duchy_cert_config.textproto- Duchy certificate to ID mapping -
duchy_id_config.textproto- External to internal Duchy ID mapping -
Protocol Configurations:
llv2_protocol_config_config.textproto- Liquid Legions v2ro_llv2_protocol_config_config.textproto- Reach-Only Liquid Legions v2hmss_protocol_config_config.textproto- Honest Majority Share Shuffle
For Testing Only
For Testing Only
Customize Kubernetes ConfigMap
Place configuration files in
~/kingdom-deployment/src/main/k8s/dev/config_files/:authority_key_identifier_to_principal_map.textproto- Principal mapping configurationknown_event_group_metadata_type_set.pb- Protobuf FileDescriptorSet for EventGroup metadata types
Configure DNS Records
Add
A records in your DNS configuration mapping domain names to the external IPs:Example for halo-cmm.org:v2alpha.kingdom.dev.halo-cmm.org→ Public API external IPv1alpha.system.kingdom.dev.halo-cmm.org→ System API external IP
Certificate Requirements
Generate certificates using Cloud Certificate Authority Service or your preferred CA. Requirements:- Support both client and server TLS
- Include DNS hostnames in Subject Alternative Name (SAN):
*.kingdom.dev.halo-cmm.org(or your domain)localhost
Updating Configuration
To update secrets or configuration:- Modify files in the Kustomization directory
- Re-apply the configuration:
Testing the Deployment
Verify the Kingdom is working properly by:- Running ResourceSetup to create resources
- Completing a multi-cluster correctness test
Terraform Configuration Reference
Next Steps
Deploy Duchy
Deploy Duchy components to complete the system
Operations Guide
Learn about creating resources and system operations