Skip to content

Component Configuration Documentation

Each application must document its deployment and runtime expectations. This documentation acts as the single source of truth for:

  • Kubernetes NetworkPolicies (ingress & egress)
  • Environment variables and secrets
  • Configuration files

Every component must have its own section and follow the structure defined below.

Required Structure Per Component

1. Component Name

The official component name as used in:

  • Kubernetes workloads and services
  • CI/CD pipelines
  • Configuration and monitoring

2. Description

A concise description explaining:

  • What the component does
  • Its responsibility in the system
  • High-level dependencies

3. Network Policy Configuration

This section defines all network access required by the component, including:

  • Inbound (Ingress) traffic to the component
  • Outbound (Egress) traffic from the component
  • Databases, message brokers, and external systems
  • Dependencies inside and outside the Kubernetes cluster

This section is the authoritative reference for Kubernetes NetworkPolicy definitions

Inbound (Ingress) Access

Defines which components are allowed to connect to this component.

Source ComponentPort

Rules

  • If the source component is not deployed inside Kubernetes, reference it by a clear name (e.g. PostgreSQL cluster, External API Gateway).

Outbound (Egress) Access

Defines which components this component connects to.

Target ComponentPort

Rules

  • All databases and external dependencies must be explicitly listed, External systems must be referenced by descriptive names along side the port of the application they need to access.

4. Environment Variables & Secrets

All environment variables used by the component must be documented, including secrets.

Environment VariableExample ValueDescription

Rules

  • Example values must never contain real secrets.
  • Optional variables must document default behavior.

5. Configuration File (If Applicable)

If the application supports or requires a configuration file:

  • An example configuration file must be provided
  • The example must include all supported configuration values
  • The expected path of the configuration file must be documented.
  • Each field must include clear inline comments explaining:
    • What the value does
    • Accepted values
    • Default behavior (if applicable)

Secret values must never appear in configuration files.

If a configuration value can be provided via multiple sources (for example, an environment variable and a configuration file), this must be explicitly documented.

The documentation must specify:

  • All supported sources
  • Which source takes precedence
  • Behavior when multiple sources are provided
SettingEnvironment VariableConfig File PathPrecedence

Example Component Documentation

Component: auth-service

Description

The Authentication Service is responsible for user authentication, token issuance, and credential validation. It relies on PostgreSQL for persistent storage and Redis for caching and session management.

Network Policy Configuration

Inbound (Ingress)

Source ComponentPort
api-gateway8080
internal-admin-ui8080

Outbound (Egress)

Target ComponentPort
PostgreSQL cluster5432
Redis cluster6379
external-identity-provider443

Environment Variables & Secrets

Environment VariableExample ValueDescription
SERVICE_PORT8080Port the service listens on
DATABASE_HOSTpostgres.prod.internalPostgreSQL hostname
DATABASE_PORT5432PostgreSQL port
DATABASE_NAMEauth_dbDatabase name
DATABASE_USERauth_userDatabase username
DATABASE_PASSWORDstored in secretDatabase password (secret)
DATABASE_SSLtrueEnables TLS for database connections
REDIS_HOSTredis.prod.internalRedis hostname
REDIS_PORT6379Redis port
JWT_SIGNING_KEYstored in secretJWT signing key
TOKEN_EXPIRY_MINUTES60Token validity duration
LOG_LEVELinfoLogging level

Configuration File Example

yaml
# Server configuration
server:
  # Port the service listens on
  port: 8080

# Database configuration
database:
  # PostgreSQL hostname
  host: postgres.prod.internal

  # PostgreSQL port
  port: 5432

  # Enables TLS for database connections
  ssl: true

# Redis configuration
redis:
  # Redis hostname
  host: redis.prod.internal

  # Redis port
  port: 6379

# Authentication settings
auth:
  # Token expiry duration in minutes
  tokenExpiryMinutes: 60

# Logging configuration
logging:
  # Supported values: debug | info | warn | error
  level: info

Configuration Source Mapping & Precedence

SettingEnvironment VariableConfig File PathPrecedence
Service portSERVICE_PORTserver.portEnvironment variable
Database hostDATABASE_HOSTdatabase.hostEnvironment variable
Database portDATABASE_PORTdatabase.portEnvironment variable
Database nameDATABASE_NAMEdatabase.nameEnvironment variable
Database SSLDATABASE_SSLdatabase.sslEnvironment variable
Redis hostREDIS_HOSTredis.hostEnvironment variable
Redis portREDIS_PORTredis.portEnvironment variable
Token expiryTOKEN_EXPIRY_MINUTESauth.tokenExpiryMinutesEnvironment variable
Log levelLOG_LEVELlogging.levelEnvironment variable