Deploy
The deploy scaffolding generates ready-to-use deployment artifacts for your service. It supports two runtime targets through a shared deployment-target seam (the Target interface): Kubernetes/k3s is the first-class target, rendered via a framework-owned Helm chart and Flux GitOps; Docker Compose covers local development. Both targets wire the same operational foundation your service serves out of the box — liveness and readiness probes, config env, the OTEL exporter, the DSN secret, and the shutdown grace period — so your local environment stays shaped like production. Use this page when you need to configure, publish, or update either target after running devedge-sdk new service.
Choosing a target
# Render both targets (the default):
devedge-sdk new service orders --resource Order --backend gorm
# Only one:
devedge-sdk new service orders --resource Order --deploy compose
# None:
devedge-sdk new service orders --resource Order --deploy noneThe --deploy flag accepts a comma-separated list of targets (k8s, compose). The default renders both. Adding a target means adding a Target adapter behind the shared interface with no change to the framework core.
Files generated in your repo
deploy/
k8s/
helmrelease.yaml # Flux HelmRelease — reconciles the framework chart
oci-repository.yaml # Flux OCIRepository source — where the chart is published
values.yaml # the THIN overlay — the only chart input you author
README.md
compose/
docker-compose.yml # the service + its declared deps, wired to the same surfaceYour repo contains only the Flux glue and a values overlay, not a Helm chart. The chart itself is embedded in the SDK and managed by the framework.
Kubernetes / k3s (Flux GitOps)
The Helm chart is framework-owned. The canonical chart lives embedded in the SDK. The planned publish target is ghcr.io/infobloxopen/charts/devedge-service.
Your repo carries:
- a Flux
HelmReleasethat reconciles the chart with your values, - an
OCIRepositorysource pointing at the chart registry, and - a thin
values.yamloverlay — the only file you edit.
The chart renders a Deployment with the following configuration:
livenessProbe→/healthzreadinessProbe→/readyz- config env
OTEL_*export- DSN as a Secret
terminationGracePeriodSeconds
It also renders a Service, an optional Ingress, and resource requests/limits.
Why the chart is not in your repo
A chart you can edit is a chart that drifts from the SDK. Keeping the chart embedded and published by the framework means every service gets the same probe paths, env names, secret handling, and grace period. A chart fix ships to all consumers via a version bump, not a copy-paste. You express service-specific intent through the values overlay.
Publishing the chart
Publishing the chart yourself is required today: until the framework publishes the chart to its own registry, extract and push the embedded chart to your own OCI registry:
# 1. Extract the embedded chart (requires devedge-sdk CLI on PATH):
devedge-sdk chart export --out ./devedge-service
# 2. Package and push to your registry:
helm package ./devedge-service
helm push devedge-service-*.tgz oci://<your-registry>/charts
# 3. Update deploy/k8s/oci-repository.yaml spec.url:
# url: oci://<your-registry>/chartsOnce the framework publishes the chart, update oci-repository.yaml to point at oci://ghcr.io/infobloxopen/charts and remove your private copy.
Wiring it up
Publish the embedded chart to your registry (see Publishing the chart above).
Edit
deploy/k8s/values.yaml: setimage.repository(andimage.tagfor a pinned release), the OTEL collector endpoint, and the DSN.In production, reference a pre-provisioned Secret viadsn.existingSecretso the connection string never lands in git.Point
deploy/k8s/oci-repository.yamlspec.urlat your published chart registry.Apply the overlay as a ConfigMap the
HelmReleasereferences:kubectl create configmap orders-values -n orders \ --from-file=values.yaml=deploy/k8s/values.yaml \ --dry-run=client -o yaml | kubectl apply -f -Commit
deploy/k8s/and let Flux reconcile it.
Docker Compose
deploy/compose/docker-compose.yml brings up the service and its declared dependencies (for example, a postgres instance). It uses the same configuration surface as the Helm chart: the config env, a healthcheck: hitting /healthz, the OTEL_* export env (with a commented otel-collector service you can enable), and a stop_grace_period that matches the chart’s grace period.
docker compose -f deploy/compose/docker-compose.yml up --buildUse the Compose target for purely local development when you do not need a cluster. It is a second real adapter behind the deployment-target seam, and it wires the same operational surface as the chart, so your local environment stays shaped like production.
Chart publication
The embedded chart is the single source of truth. It is consumed two ways:
- Production / GitOps. The chart is published to an OCI registry. The emitted
HelmReleaseandOCIRepositoryreference it by version. Until the framework publishes toghcr.io/infobloxopen/charts/devedge-service, publish to your own registry (see Publishing the chart above). - Local / dev.
de project up --deployrenders the same embedded chart directly viahelm template. Both paths use the same chart source and cannot drift from each other.
Graceful shutdown
The generated main wires signal.NotifyContext(ctx, SIGTERM, os.Interrupt). When Kubernetes sends SIGTERM to terminate a pod, this cancels the serve context: the gRPC and HTTP servers drain in-flight requests, the readiness loop stops, and the OTel exporter flushes before exit.
The chart’s terminationGracePeriodSeconds and Compose’s stop_grace_period (both 30 seconds by default) set the time budget for that drain.
terminationGracePeriodSeconds and stop_grace_period in sync. If they diverge, one target will force-kill the process before the drain completes.Future targets
AWS ECS is a registered seam stub. It satisfies the same Target interface, so the seam is proven open, but renders nothing yet — --deploy ecs returns a “not implemented” message. Implementing it requires adding an adapter with no change to the core interface.
Runtime dependencies
Deploy artifacts are templates, not runtime dependencies. Rendering them adds nothing to your service’s runtime dependency closure. The chart and its YAML tooling live entirely in the CLI, not in the service binary.