Deployment
Deployment guide for the ID Generator service — Helm chart installation, configuration, Docker setup, and local development.
Helm chart (Kubernetes)
The openg2p-id-generator Helm chart deploys the service on Kubernetes, following OpenG2P conventions.
Prerequisites
Kubernetes 1.24+
Helm 3.x
PostgreSQL (typically
commons-postgresqlin the OpenG2P cluster)Istio (optional, for VirtualService routing)
Quick install
helm repo add openg2p https://openg2p.github.io/openg2p-helm
helm repo update
helm install id-generator openg2p/openg2p-id-generator \
-n <namespace> --create-namespaceInstall with custom ID types
helm install id-generator openg2p/openg2p-id-generator \
-n trial --create-namespace \
-f my-values.yamlExample my-values.yaml:
Upgrade
To add or remove ID types, update appConfig.idTypes and run helm upgrade. Pods restart with the new ConfigMap.
Uninstall
Helm values reference
Global parameters
global.idGeneratorHostname
Hostname for Istio VirtualService
idgenerator.trial.openg2p.org
global.postgresqlHost
PostgreSQL server host
commons-postgresql
Application config
idGenerator.appConfig.idTypes
Map of ID type name → config
See below
idGenerator.appConfig.idTypes.<name>.idLength
Number of digits (2–32)
—
idGenerator.appConfig.poolMinThreshold
Min available IDs before replenishment
1000
idGenerator.appConfig.poolGenerationBatchSize
IDs generated per replenishment cycle
5000
idGenerator.appConfig.poolCheckIntervalSeconds
Seconds between pool checks
30
Default ID types:
Scaling
idGenerator.replicaCount
Number of pod replicas
1
idGenerator.autoscaling.enabled
Enable HPA
false
idGenerator.autoscaling.minReplicas
Minimum replicas
1
idGenerator.autoscaling.maxReplicas
Maximum replicas
5
Istio
idGenerator.istio.enabled
Enable Istio resources
true
idGenerator.istio.virtualservice.enabled
Create VirtualService
true
idGenerator.istio.virtualservice.gateway
Istio gateway name
internal
idGenerator.istio.virtualservice.prefix
URL prefix match
/v1/idgenerator/
Startup sequence
postgres-init Job — creates the database and user in PostgreSQL
Init container — waits until the database is accessible with the correct credentials
Main container — starts the service, creates tables, fills the initial pool
Startup probe — waits up to 5 minutes for the service to be ready
Kubernetes resources created
ConfigMap
Application config YAML (ID types, filters, pool)
Deployment
ID Generator pods
Service
ClusterIP service (port 80 → 8000)
Secret
Auto-generated DB user password
Job
postgres-init (creates database and user)
VirtualService
Istio routing (if enabled)
HPA
Horizontal Pod Autoscaler (if enabled)
Docker
Docker Compose (recommended for local)
Start both PostgreSQL and the service with a single command:
This will:
Start PostgreSQL 16 with a persistent volume
Wait for PostgreSQL to be healthy
Build the ID Generator image and start it on port 8000
Docker run (with existing database)
Building multi-architecture images
The official image supports both linux/amd64 (Intel/AMD servers) and linux/arm64 (Apple Silicon, ARM servers). Use Docker buildx for multi-arch builds.
One-time setup — create a builder that supports multi-arch:
Build for a single platform (load locally):
Build for both architectures simultaneously:
--load only works with single-platform builds. For multi-arch, Docker cannot store a manifest list locally — you must push to a registry (see below).
Publishing to Docker Hub
Normally, images are built and pushed to Docker Hub automatically by the GitHub Actions workflow on every push. This is a thin stub that delegates to the central reusable workflow in openg2p-packaging, which handles versioning, Helm chart publishing, and changelog generation. See the CI onboarding guide for details.
For manual multi-arch publishing (e.g., hotfix releases):
Replace <tag> with the intended version (e.g., develop, v0.1.0).
Local development (without Docker)
Prerequisites
Python 3.11+
PostgreSQL 14+
Setup
Environment variables
DB_HOST
localhost
PostgreSQL host
DB_PORT
5432
PostgreSQL port
DB_NAME
idgenerator
Database name
DB_USER
postgres
Database user
DB_PASSWORD
postgres
Database password
CONFIG_PATH
config/default.yaml
Path to YAML config file
UVICORN_WORKERS
1
Uvicorn worker processes
UVICORN_LOG_LEVEL
info
Log level
Last updated
Was this helpful?