Skip to content

App Deployments (4a+): config-file mounts via files:#219

Merged
v0l merged 1 commit into
masterfrom
feat/app-deployments-compose-files
Jul 24, 2026
Merged

App Deployments (4a+): config-file mounts via files:#219
v0l merged 1 commit into
masterfrom
feat/app-deployments-compose-files

Conversation

@v0l

@v0l v0l commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Follow-up to the shared compose parser (#218). Adds config-file mounts to the app compose grammar so file-driven apps (e.g. strfry's strfry.conf, nginx, haven) are deployable — env vars alone aren't enough for them.

Grammar

A files: list per service — read-only config files injected into the container:

services:
  strfry:
    image: ghcr.io/hoytech/strfry:latest
    files:
      - path: /etc/strfry.conf
        content: |                       # templated, ${…} from config:/secrets:
          relay { info { name = "${relay_name}"; } }
      - path: /etc/custom.conf
        content_from: custom_conf         # customer-supplied whole file
      - path: /etc/api.key
        content: "${API_KEY}"
        sensitive: true                   # -> Secret, not ConfigMap
config:
  - { name: relay_name, type: string, default: "My Relay" }
  - { name: custom_conf, type: file }     # new field type for whole-file input
  • Content source is exactly one of inline content (templated) or content_from a config field (new type: file).
  • sensitive: true → rendered into a Secret; otherwise a ConfigMap. The operator mounts each at path via subPath (single file, doesn't shadow the directory).
  • Kept distinct from volumes: (persistent read-write PVCs) — files: are injected read-only config.

Validation (shared parser → admin API)

Absolute, non-.. path; single content source; ≤256 KiB inline; content_from must reference a declared config field; a file may not overlap a data-volume mount.

API

  • resolve_files(vars) → per-service [ResolvedFile { path, content, sensitive }] for the operator.
  • referenced_vars() now also scans file-content templates.

Tests

4 new (strfry.conf multi-file example incl. sensitive + content_from, and every rejection path); 11 total in the crate.

Next

4b) operator reconcile — will render files: into ConfigMaps/Secrets and subPath-mount them alongside Deployment/Service/Ingress/PVC.

Extend the shared compose grammar so file-driven apps (e.g. strfry.conf)
are deployable, not just env-driven ones.

- Service 'files:' entries: read-only config files injected into the
  container. Content source is exactly one of inline templated 'content'
  (${...} from config/secrets) or 'content_from' a config field (incl. new
  ConfigField 'type: file' for a customer-supplied whole file). Optional
  'sensitive' renders into a Secret instead of a ConfigMap; the operator
  mounts each at its 'path' via subPath (single file, no dir shadowing).
- Validation (shared parser -> admin API): absolute/non-traversal path,
  single content source, <=256 KiB inline, content_from must reference a
  declared config field, and a file may not overlap a data volume mount.
- resolve_files() renders per-service (path, content, sensitive);
  referenced_vars() now also scans file content templates.
- files: (injected, read-only) is kept distinct from volumes: (PVC,
  read-write). 4 new tests (strfry.conf example + all rejection paths).

Part of work/app-deployments.md.
@v0l
v0l merged commit c915580 into master Jul 24, 2026
8 checks passed
@v0l
v0l deleted the feat/app-deployments-compose-files branch July 24, 2026 15:40
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.

1 participant