Skip to content

feat(config): Secret type, env-var overrides with warnings, k8s deployment guide - #9

Closed
manudiv16 wants to merge 1 commit into
osodevops:mainfrom
manudiv16:hideous-frog
Closed

manudiv16 wants to merge 1 commit into
osodevops:mainfrom
manudiv16:hideous-frog

Conversation

@manudiv16

Copy link
Copy Markdown
Contributor

Closes #1

Two complementary patterns for injecting configuration outside TOML files, designed for Kubernetes deployments with Secrets Store CSI Driver or projected volumes. No secret ever needs to live in a ConfigMap.

1. Secret type with file refs

Sensitive fields use a Secret newtype that deserializes from either a plain string or a { file = "path" } inline table (Kubernetes projected volumes). File contents are trimmed; a missing file fails startup with a clear error. Debug is redacted (Secret(REDACTED)).

Fields: kafka.security.sasl_username / sasl_password, iceberg.aws_access_key_id / aws_secret_access_key, iceberg.rest.credential / oauth2_client_id / oauth2_client_secret.

2. Env var overrides

K2I_ + uppercase path with _ separators. Invalid numeric/enum values warn (TOML preserved), unrecognized K2I_* variables warn for typo detection.

Docs

  • docs/kubernetes.md — projected Secret volumes, env/secretKeyRef, Secrets Store CSI Driver, 38-variable table
  • config/example.toml — both patterns documented inline

Verification

  • cargo check --workspace --tests — clean, zero warnings
  • cargo test --workspace — 285 passed, 0 failed
  • Env typo smoke test — warns on K2I_KAFKA_TOPC, validate passes
  • 9 new tests: file refs, missing-file error, plain-string compat, Debug redaction, env overrides (mutex-serialized)

…yment guide

- Replace _file twin fields with Secret newtype (plain string or
  { file = "path" } TOML forms, Debug redacted)
- Warn on invalid numeric/enum env values instead of silently ignoring
- Warn on unrecognized K2I_* variables (typo detection)
- Serialize env-var tests through a mutex to remove race
- Add docs/kubernetes.md covering projected volumes, env injection,
  and Secrets Store CSI Driver
@manudiv16

Copy link
Copy Markdown
Contributor Author

Superseded by #8 — combined into a single PR with the cloud object-store work. Same tree, conflict-resolved and verified (289 tests green).

@manudiv16 manudiv16 closed this Jul 25, 2026
sionsmith pushed a commit that referenced this pull request Jul 28, 2026
GCS/Azure object stores + credential chain docs (PR #8):
- GCS backend with ADC / Workload Identity Federation
- Azure backend (az:// and abfs://) with DefaultAzureCredential chain
- S3 default credential chain docs (env -> IMDS -> IRSA)

Config secret injection (PR #9):
- Secret newtype for credential fields: plain string or
  { file = "path" } TOML forms, Debug redacted, expose() accessors
- K2I_* env var overrides with warnings on invalid numeric/enum
  values and unrecognized variables (typo detection)
- Mutex-serialized env-var tests
- docs/kubernetes.md: projected volumes, env injection, Secrets
  Store CSI Driver, full variable table
- azure_access_key uses Secret for consistency

Closes #1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ghcr.io/osodevops/k2i:latest image appears to be private / access denied

1 participant