Infrastructure
The platform runs as container-based on Kubernetes. Each component can be independently scaled and managed.
Infrastructure Architecture
Three-tier architecture: Load Balancing, Application, and Data layers. Load balancing is done through Ingress Controller.
Container Structure
| Container | Base Image | Port |
|---|---|---|
| digital-id | node:18-alpine | 3000 |
| Issuer-agent | bcgovimages/aries-cloudagent:py3.9-1.1.1 | 8020/8021 |
| Holder-agent | bcgovimages/aries-cloudagent:py3.9-1.1.1 | 8030/8031 |
| mediator | bcgovimages/aries-cloudagent:py3.9-1.1.1 | 3000/3001 |
| tails-server | bcgovimages/tails-server | 6543 |
| postgresql | postgres:14-alpine | 5432 |
Kubernetes Resources
| Resource | Description | Count |
|---|---|---|
| Namespace | identity-platform isolation | 1 |
| Deployments | API, Issuer, Holder, Mediator | 4 |
| Services | ClusterIP + LoadBalancer | 5 |
| Ingress | External traffic routing | 1 |
| ConfigMaps | Agent configuration | 4 |
| Secrets | Wallet keys, DB credentials | 3 |
| PVC | PostgreSQL, Wallet storage | 2 |
Example Deployment Structure
apiVersion: apps/v1
kind: Deployment
metadata:
name: digital-id-api
namespace: identity-platform
spec:
replicas: 2
selector:
matchLabels:
app: digital-id-api
Resource Requirements
| Service | CPU Request | Memory Request | Replicas |
|---|---|---|---|
| API | 250m | 512Mi | 2-10 |
| Issuer Agent | 500m | 1Gi | 2-5 |
| Holder Agent | 500m | 1Gi | 2-5 |
| PostgreSQL | 1000m | 2Gi | 1 (HA: 3) |
Quick Start
You can use Docker Compose for local development:
docker-compose.yml
services:
api:
image: digital-id:latest
ports:
- "3000:3000"
environment:
- DATABASE_URL=postgresql://user:pass@db:5432/identity
Issuer-agent:
image: bcgovimages/aries-cloudagent:py3.9-1.1.1
ports:
- "8020:8020"
- "8021:8021"
Resource Optimization
Use minimum requirements for startup, HPA will automatically scale under load. Don't over-allocate resources unnecessarily.