Skip to content

DSL and YAML Reference

This file is a compact reference for the fields and helper constructors used by helm-me.

For a task-oriented introduction, start with Your First App. For kubeconfig, namespace, import behavior, and storage details, see Cluster Configuration.

Enums

PullPolicy

  • PullPolicy.ALWAYS
  • PullPolicy.IF_NOT_PRESENT
  • PullPolicy.NEVER

Reconcile

  • Reconcile.APPLY
  • Reconcile.REPLACE
  • Reconcile.CREATE_IF_MISSING
  • Reconcile.FAIL_IF_EXISTS

ResourceProfile

  • ResourceProfile.SMALL
  • ResourceProfile.MEDIUM
  • ResourceProfile.LARGE

YAML equivalents:

  • small
  • medium
  • large

App-level fields

Preferred YAML envelope:

apiVersion: helm-me/v1alpha1
kind: Application
metadata:
  name: hello-app
  namespace: demo
Field Meaning
metadata.name or name Application name and resource prefix
metadata.namespace or namespace Target namespace; defaults to app name when omitted
pull_policy Default image pull policy for web components
tag Default image tag for web components
resources Default resource profile/spec for web components
replicas Default replica count for web components
image_pull_secrets Image pull secret names added to pods
expose.ingress or publish Ingress configuration
secrets Inline secrets created with the app
components Ordered list of components
hooks Pre/post-deploy jobs

web() / type: web

Field Meaning
image Container image
command Optional container command override
port Container and service port
replicas Replica count
enabled Boolean or param() expression
env Plain environment variables
cors CORS configuration
sqlite SQLite volume/storage config
secret_refs / secretEnv Secret-backed environment variables
serviceEnv Service host or host:port references to other components
inputs HTTP dependencies on other components
probes Liveness/readiness HTTP probes
resources Resource requests/limits or profile
public_paths Paths exposed through ingress
internal_paths Cluster-only paths
base_path Base path injected into the app

worker() / type: worker

Field Meaning
image Container image
command Worker entrypoint / command
replicas Replica count
env Plain environment variables
secret_refs / secretEnv Secret-backed environment variables
serviceEnv Service host or host:port references
sqlite SQLite volume/storage config
resources Resource requests/limits or profile

Workers render as Deployments without requiring an HTTP port or Service.

postgresql() / type: postgresql

Field Meaning
version PostgreSQL version, e.g. "16"
database Database name
user Database user
password Database password
storage PVC config or string size shorthand
init_scripts SQL files mounted into init directory

Auto-created secret keys:

  • DATABASE_URL
  • POSTGRES_DB
  • POSTGRES_USER
  • POSTGRES_PASSWORD

redis() / type: redis

Field Meaning
version Redis version, e.g. "7"
maxmemory Redis maxmemory setting
storage PVC config or string size shorthand
password Optional Redis password

Auto-created secret keys:

  • REDIS_PASSWORD

Helper constructors

Helper Purpose
image(...) Image repository, tag, pull policy
ingress(...) Ingress host, class, TLS
secret(...) Inline opaque secret
tls_secret(...) Inline TLS secret from PEM strings or PEM files
secret_ref(...) Reference to a secret key
worker(...) Background worker component
tls_secret_ref(...) Reference to an existing TLS secret
http_input(...) HTTP dependency between components
cors(...) CORS config
sqlite(...) SQLite mount and storage config
persistent(...) PVC config
probes(...) Liveness/readiness probes
resources(...) Resource request/limit config
requests(...) Resource requests only
limits(...) Resource limits only
hook(...) Pre/post-deploy job
param(...) Environment-backed runtime parameter

YAML-specific shortcuts

YAML form Equivalent
type: postgresql postgresql(...)
type: redis redis(...)
type: worker worker(...)
omitted type web(...)
storage: "1Gi" persistent("1Gi")
resources: small ResourceProfile.SMALL
resources: {cpu: "...", memory: "..."} resources(cpu=..., memory=...)
secretEnv: {VAR: {component: db, key: DATABASE_URL}} secret_ref(db, "DATABASE_URL")
secretEnv: {VAR: {name: my-secret, key: TOKEN}} secret_ref("my-secret", "TOKEN")
serviceEnv: {REDIS_HOST: {component: cache, port: 6379}} env={"REDIS_HOST": ServiceRef("cache", 6379)}

TLS notes:

  • expose.ingress.tls.secretName references an existing TLS secret in the cluster.
  • expose.ingress.tls.name plus cert_file / key_file creates a TLS secret as part of the app manifests.
  • Relative cert_file / key_file paths are resolved from the spec file directory.

Minimal examples

YAML

apiVersion: helm-me/v1alpha1
kind: Application
metadata:
  name: hello-app

components:
  backend:
    type: web
    image: traefik/whoami:latest
    port: 80

Python

from helm_me import App, image, web


class Deploy(App):
    name = "hello-app"
    backend = web(image=image("traefik/whoami:latest"), port=80)