Skip to content

feat(lifecycle): add MinIO subchart with secure credential architecture for log archival (v0.8.0)#32

Merged
vigneshrajsb merged 4 commits intomainfrom
feat/archive-build-logs
Mar 3, 2026
Merged

feat(lifecycle): add MinIO subchart with secure credential architecture for log archival (v0.8.0)#32
vigneshrajsb merged 4 commits intomainfrom
feat/archive-build-logs

Conversation

@vigneshrajsb
Copy link
Contributor

@vigneshrajsb vigneshrajsb commented Mar 1, 2026

Goal

Build and deploy job logs are permanently lost when k8s Job pods are evicted or TTL-expired (~24h). This PR adds MinIO as an optional in-cluster S3-compatible object store so logs can be archived at job completion time and retrieved even after live pods are gone. It also supports AWS S3 via IRSA for production environments.

Changes

File Change
Chart.yaml Add minio 17.0.21 Bitnami subchart dependency (disabled by default); bump chart version → 0.8.0
values.yaml Add objectStore: section (type, endpoint, port, bucket, SSL, region); add secrets.objectStore section; add minio: subchart values; wire minio.auth.existingSecret to shared secret
templates/secret-objectstore.yaml (new) Kubernetes Secret storing OBJECT_STORE_ACCESS_KEY and OBJECT_STORE_SECRET_KEY; shared by both the app and MinIO via existingSecret
templates/configmap.yaml Emit OBJECT_STORE_* env vars (no credentials); guarded by minio.enabled flag; add SECRET_OBJECT_STORE_NAME; hook changed to pre-install,pre-upgrade; S3 mode validates required region
templates/deployments.yaml Add envFrom: secretRef for secrets.objectStore — injects credentials into all pods automatically
templates/_helpers.tpl Add ..helper.objectStoreSecretName and ..helper.minioSvcEndpoint helpers

Credential architecture

Credentials are not in the ConfigMap. They live exclusively in a Kubernetes Secret:

ConfigMap Secret (<release>-objectstore)
OBJECT_STORE_TYPE OBJECT_STORE_ACCESS_KEY
OBJECT_STORE_ENDPOINT OBJECT_STORE_SECRET_KEY
OBJECT_STORE_PORT
OBJECT_STORE_BUCKET
OBJECT_STORE_USE_SSL
SECRET_OBJECT_STORE_NAME

The same secret is referenced by minio.auth.existingSecret — MinIO and the app share one credential source with no duplication.

How it works

  1. Opt-in: MinIO is disabled by default (minio.enabled: false). When disabled, the ConfigMap emits no OBJECT_STORE_* vars — no broken env vars pointing at a non-existent service.
  2. Credentials: Stored in a dedicated Secret (created on install, resource-policy: keep). Set secrets.objectStore.accessKey / secretKey in your override values or let the chart generate random values.
  3. S3 mode: Set objectStore.type: s3 + objectStore.region for AWS S3 via IRSA — no static credentials needed.
  4. App-side gating: The lifecycle backend checks logArchival.enabled in global_config before making any object store calls — enabling the subchart alone is safe.

Rollout

minio:
  enabled: true

secrets:
  objectStore:
    accessKey: <from-sealed-secret>
    secretKey: <from-sealed-secret>

Then activate archival via global_config:

{ "logArchival": { "enabled": true, "retentionDays": 14 } }

Test plan

  • helm template with defaults (minio.enabled=false) — no OBJECT_STORE_* vars in ConfigMap
  • helm template --set minio.enabled=true — ConfigMap has OBJECT_STORE_* (no credentials), Secret has OBJECT_STORE_ACCESS_KEY/SECRET_KEY, deployments have envFrom: secretRef
  • helm template --set objectStore.type=s3 --set objectStore.region=us-east-1 — ConfigMap has S3 vars only
  • helm template --set objectStore.type=s3 — fails with objectStore.region is required error
  • In a test cluster: MinIO pod reaches Running, bucket lifecycle-logs auto-created, app pods have credentials available as env vars

🤖 Generated with Claude Code

binlab
binlab previously approved these changes Mar 3, 2026
Copy link
Contributor

@binlab binlab left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

vigneshrajsb and others added 3 commits March 3, 2026 11:34
Adds MinIO as an optional Bitnami subchart to the lifecycle umbrella
chart, enabling S3-compatible object storage for build and deploy log
archival. When enabled, completed job logs are persisted in MinIO before
the k8s Job pods are evicted or TTL-expired, allowing the UI to retrieve
archived logs even after the live pods are gone.

Changes:
- Chart.yaml: add minio 14.8.5 subchart dependency (disabled by default)
- Chart.yaml: bump chart version to 0.7.0 to trigger publish
- values.yaml: add minio: section with defaults (20Gi persistence, 100m/256Mi requests)
- templates/configmap.yaml: expose MINIO_ENDPOINT, MINIO_PORT, MINIO_BUCKET,
  MINIO_USE_SSL env vars when minio.enabled=true

To enable: set minio.enabled=true and configure minio.auth.rootUser/rootPassword
as secrets. The lifecycle app reads logArchival.enabled from global_config
to gate actual archival calls.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…O subchart

- Add secret-objectstore.yaml to manage MinIO/S3 credentials as a
  Kubernetes Secret instead of plaintext values
- Add objectStoreSecretName and minioSvcEndpoint helper functions
- Replace MINIO_* configmap keys with OBJECT_STORE_* keys and add
  SECRET_OBJECT_STORE_NAME; guard config behind minio.enabled
- Add objectStore top-level values block for type/bucket/region/endpoint
- Remove plaintext rootUser/rootPassword from minio.auth; wire
  existingSecret to the new object store secret
- Add minio.fullnameOverride to allow custom service name resolution
- Change configmap hook to pre-install,pre-upgrade
- Upgrade MinIO subchart from 14.8.5 to 17.0.21 with bitnamilegacy images
… v0.8.0

- deployments.yaml: add envFrom secretRef for secrets.objectStore so
  OBJECT_STORE_ACCESS_KEY/SECRET_KEY are injected into all pods automatically
- Chart.yaml: bump version to 0.8.0 (main landed 0.7.0)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vigneshrajsb vigneshrajsb force-pushed the feat/archive-build-logs branch from 9cb808e to 0a23f00 Compare March 3, 2026 19:35
@vigneshrajsb vigneshrajsb changed the title feat: add MinIO subchart for build/deploy log archival (v0.7.0) feat(lifecycle): add MinIO subchart with secure credential architecture for log archival (v0.8.0) Mar 3, 2026
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vigneshrajsb vigneshrajsb merged commit 1bab92e into main Mar 3, 2026
1 check passed
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.

2 participants