Kubernetes service accounts
Overview
The opencrvs-services Helm chart creates a dedicated Kubernetes ServiceAccount for each OpenCRVS workload and sets the matching serviceAccountName on its pods.
On managed Kubernetes (e.g. AWS EKS, Google GKE, Azure AKS) you can map these service accounts to cloud identities (IAM roles, workload identities). Access to managed components such as PostgreSQL, Redis or object storage can then be granted to particular pods only, instead of to every virtual machine in the cluster, which significantly reduces the attack surface.
Default service accounts
Service account names match workload names:
authclientcountryconfigdashboards, whendashboards.enabledistruedocumentseventsgatewaylogindata-cleanup, whendata_cleanup.enabledistrueon-db-restore-cronjob, whenon_restore_cronjob.enabledistrue
Helm pre/post deployment jobs share one service account, deployment-jobs. This includes validation, datastore setup, data migration, data seed and Elasticsearch reindex jobs.
Annotating service accounts
Global annotations apply to all workload service accounts:
Workload-specific annotations override global annotations with the same key:
Annotations for the deployment jobs service account:
Using existing service accounts
If service accounts are managed outside of the chart, set service_account.create to false and create matching service accounts in the namespace. A custom name can be set per workload:
Configuration options
service_account.create
true
Create one ServiceAccount per workload.
service_account.annotations
{}
Annotations applied to all workload ServiceAccounts.
service_account.automount_service_account_token
true
Controls automountServiceAccountToken on ServiceAccounts and pods. Can be overridden per workload.
<workload>.service_account.name
workload name
Custom ServiceAccount name for one workload.
<workload>.service_account.annotations
{}
Annotations for one workload's ServiceAccount.
deployment_jobs.service_account.name
deployment-jobs
ServiceAccount shared by Helm pre/post deployment jobs.
deployment_jobs.service_account.annotations
Helm hook annotations
Annotations for the deployment jobs ServiceAccount.
For the complete reference, see charts/opencrvs-services/README.md.
Last updated