Overview
This guide walks you through deploying a Duchy to Google Kubernetes Engine (GKE). A Duchy is a computation node in the Halo Cross-Media Measurement System that participates in secure multi-party computation protocols.Prerequisites
Complete the deployment prerequisites including:- Bazel/Bazelisk installation
- Google Cloud SDK configuration
- kubectl installation
- Terraform installation
- Duchy registration with Kingdom (see below)
Duchy Registration
Before deployment, register your Duchy with the Kingdom operator offline.Prepare Registration Information
Share the following with the Kingdom operator:
- Duchy name (unique string ID)
- CA (root) certificate
- Consent signaling (leaf) certificate
Duchy Components
For a Duchy namedworker1, the deployment creates:
Services
Services
worker1-async-computation-control-server(Cluster IP)worker1-internal-api-server(Cluster IP)worker1-computation-control-server(External LoadBalancer) - System APIworker1-requisition-fulfillment-server(External LoadBalancer) - Public API
Deployments
Deployments
worker1-async-computation-control-server-deploymentworker1-computation-control-server-deploymentworker1-herald-daemon-deploymentworker1-requisition-fulfillment-server-deploymentworker1-spanner-computations-server-deploymentworker1-mill-job-scheduler-deployment
PodTemplates (Mill Jobs)
PodTemplates (Mill Jobs)
worker1-llv2-mill- Liquid Legions v2 protocolworker1-hmss-mill- Honest Majority Share Shuffle protocol
CronJobs
CronJobs
worker1-computations-cleaner-cronjob
RBAC
RBAC
worker1-mill-job-scheduler(Role)worker1-mill-job-scheduler-binding(RoleBinding)
Deployment Steps
Provision Infrastructure with Terraform
Use the example Terraform configuration:Create a Initialize and apply:
backend.tf file:backend.tf
The Terraform configuration creates:
- GKE cluster named
worker1-duchy - Cloud Spanner instance for computation storage
- Cloud Storage bucket for blob storage
- Two node pools: default (e2-standard-2, max 2 nodes) and spot (c2-standard-4, max 20 nodes)
- KMS key ring for encryption
Customize Kubernetes Secret
Prepare files in
~/worker1-duchy-deployment/src/main/k8s/dev/worker1_duchy_secret/:Required Files:-
all_root_certs.pem- TLS trusted CA store- Root certificates for:
- All other Duchies
- EDPs that fulfill requisitions at this Duchy
- This Duchy’s own CA
- Root certificates for:
-
worker1_tls.pem- Duchy’s TLS certificate (PEM format) -
worker1_tls.key- Private key for TLS certificate (PEM format) -
worker1_cs_cert.der- Consent signaling certificate (DER format) -
worker1_cs_private.der- Private key for consent signaling (DER format) -
duchy_cert_config.textproto- Duchy certificate to ID mapping -
xxx_protocols_setup_config.textproto- Protocol configuration- Replace
xxxwithaggregatorornon_aggregator - Set the role appropriately
- Aggregator Example
- Replace
-
worker1_kek.tink- Key encryption key for HMSS protocol Generate using Tinkey:
Customize Kubernetes ConfigMap
Place
authority_key_identifier_to_principal_map.textproto in:
~/worker1-duchy-deployment/src/main/k8s/dev/config_files/See Creating Resources.Certificate Requirements
Use Cloud Certificate Authority Service or your preferred CA. TLS Certificate Requirements:- Support both client and server TLS
- Include in Subject Alternative Name (SAN):
- Hostnames for external IPs (e.g.,
*.duchy.dev.halo-cmm.org) localhost
- Hostnames for external IPs (e.g.,
Terraform Configuration
Key variables for Duchy deployment:Testing the Deployment
Verify the Duchy works correctly by completing a multi-cluster correctness test with the deployed Duchy and Kingdom.Updating Configuration
To update secrets or configuration:- Modify files in the Kustomization directory
- Re-apply:
Next Steps
Operations Guide
Learn about managing and operating the Duchy
Correctness Testing
Run end-to-end tests