Skip to content

k8s: expand chart sugar — probes, hpa/pdb, multi-port, ingress class, label scheme#3

Merged
polyedre merged 1 commit into
ci-guixfrom
k8s-chart-sugar
Jul 3, 2026
Merged

k8s: expand chart sugar — probes, hpa/pdb, multi-port, ingress class, label scheme#3
polyedre merged 1 commit into
ci-guixfrom
k8s-chart-sugar

Conversation

@polyedre

@polyedre polyedre commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

Expands (hexol k8s) to cover the sugar gaps found converting the podinfo Helm chart to hexol, without pulling in any Helm-lifecycle machinery.

New/expanded sugar:

  • Workload: liveness/readiness/startup probes, deployment strategy (RollingUpdate/Recreate + maxSurge/maxUnavailable), multiple container ports, empty-dir volumes, pod-template annotations, termination-grace-period.
  • hpa (autoscaling/v2) with min/max replicas + CPU/memory target utilization.
  • pdb (policy/v1) with minAvailable/maxUnavailable.
  • Multi-port service (list of port tuples; single-port form unchanged).
  • ingress ingressClassName + repeated host-rule for multiple hosts/paths.
  • Label scheme: current-label-key (default app) + with-label-key scope so charts selecting on app.kubernetes.io/name interop; default unchanged.

Why

A real upstream chart (podinfo) uses all of the above; the previous k8s vocab only had single-port workloads/services, single-host ingress, a hardcoded app label, and no probes/hpa/pdb/strategy — so a faithful conversion wasn't possible.

Intentionally skipped (Helm lifecycle)

Hooks, subcharts/dependencies, and .Release/.Chart/.Capabilities builtins — out of scope for a declarative resource library.

Tests

make test, make test-examples, and hexol render/render -o yaml on examples/kubernetes.scm all pass; existing tests/examples unchanged in behavior.

… label scheme

Cover the gaps a real upstream chart (podinfo) needs when converted to
(hexol k8s), staying clear of Helm-lifecycle features.

Workload/deployment sugar:
- liveness/readiness/startup probes via a `probe` sub-spec (httpGet/tcp/exec)
- `strategy` sub-spec (RollingUpdate/Recreate + maxSurge/maxUnavailable)
- multiple container ports via a `ports` list of `port` tuples
- `empty-dir` scratch volumes alongside cm/sec/pvc/hostPath refs
- pod-template `annotations`
- `termination-grace-period`

New builders:
- `hpa` (autoscaling/v2 HorizontalPodAutoscaler): min/max replicas + CPU/memory
- `pdb` (policy/v1 PodDisruptionBudget): minAvailable/maxUnavailable
- multi-port `service` (`ports` list; single-port form unchanged)
- `ingress` ingressClassName + repeated `host-rule` for multiple hosts/paths

Label scheme: `current-label-key` parameter (default `app`) + `with-label-key`
scope, so charts selecting on app.kubernetes.io/name interop; default unchanged.

Examples + tests updated; existing tests/examples untouched in behavior.
@polyedre
polyedre merged commit aa217d8 into ci-guix Jul 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.

1 participant