Skip to content

Environment Variables

Before You Read

This page covers non-secret configuration. For secret values (passwords, keys, tokens) see Secrets Management.

Configuration Sources

Each service receives configuration from three sources, in priority order:

  1. Kubernetes Secrets (from GCP Secret Manager via ESO) — sensitive values
  2. ConfigMaps — non-sensitive environment-specific values
  3. Helm chart defaults (values.yaml) — application defaults

Helm Chart Values

The microservice Helm chart template (infrastructure-configuration/projects/templates/microservice/helm/) uses a values.yaml per environment.

Common values structure:

# values.yaml
replicaCount: 1

image:
  repository: us-central1-docker.pkg.dev/orofi-dev-cloud/orofi/microservice-identity
  tag: "latest"
  pullPolicy: IfNotPresent

service:
  type: ClusterIP
  port: 80

resources:
  requests:
    cpu: "100m"
    memory: "128Mi"
  limits:
    cpu: "500m"
    memory: "512Mi"

env:
  APP_ENV: dev
  LOG_LEVEL: debug

# Per-environment overrides in values-dev.yaml, values-staging.yaml:

[NEEDS TEAM INPUT: provide the actual environment-specific values for each service, especially APP_ENV, LOG_LEVEL, database connection variable names, and any service-specific flags.]

Adding a Non-Secret Environment Variable

  1. Add to the service's values.yaml (or values-{env}.yaml for env-specific overrides):
env:
  MY_FEATURE_FLAG: "true"
  MAX_CONNECTIONS: "100"
  1. In the Helm chart template deployment.yaml, env vars from the values.env map are injected:
env:
{{- range $key, $val := .Values.env }}
  - name: {{ $key }}
    value: {{ $val | quote }}
{{- end }}
  1. Open a PR in infrastructure-configuration — ArgoCD deploys on merge.

Per-Environment Configuration

Use separate values files for environment-specific config:

helm/
├── values.yaml          ← defaults (common to all environments)
├── values-dev.yaml      ← dev overrides
└── values-staging.yaml  ← staging overrides

Example override:

# values-staging.yaml
env:
  APP_ENV: staging
  LOG_LEVEL: info
  MAX_CONNECTIONS: "200"

ConfigMaps

[NEEDS TEAM INPUT: does the platform use ConfigMaps for any configuration? If yes, document which services use them, what keys they contain, and how they're created (in-chart or separate resource).]

Common Environment Variables

[NEEDS TEAM INPUT: document the environment variables each service expects. Include names, types, example values, and which are required vs optional. This is critical for new engineers setting up local development.]

Example table: | Variable | Required | Example | Description | |----------|----------|---------|-------------| | APP_ENV | Yes | dev, staging, prod | Environment name | | LOG_LEVEL | No | debug, info, warn | Log verbosity | | DB_HOST | Yes | microservice-identity-db.dev.orofi.xyz | Database hostname | | DB_PORT | No | 3306 | Database port | | DB_NAME | Yes | db_microservice_identity | Database name | | REDIS_URL | Yes | redis://redis.dev.orofi.xyz:6379 | Redis connection URL | | KAFKA_BROKERS | Yes | kafka.kafka.svc.cluster.local:9092 | Kafka broker list |

See Also