Skip to content

Scripts

Kubernetes helper scripts live in:

apps/backend/kubernetes/scripts/

Some scripts predate the current Helm chart. Use the status table before running one:

ScriptCurrent use
k3d-setup.shComplete local k3d build and Helm deployment
deploy.shThin helm upgrade --install wrapper
build-images.shBuild API and executor images only
migrate-db.shDevelopment schema push from host tooling
setup-config.shLegacy resource generator; names are not wired into the current chart
dev-bootstrap.shWrites local PostgreSQL values, but its suggested Compose next step is unavailable in this directory
dev.shStale; expects a Compose file that is not present

This is the maintained all-in-one local Kubernetes path:

Terminal window
cd apps/backend/kubernetes
# Create the cluster, build images, and install the chart.
./scripts/k3d-setup.sh
# Rebuild images and restart Deployments.
./scripts/k3d-setup.sh rebuild
# Print cluster and workload status.
./scripts/k3d-setup.sh status
# Delete the k3d cluster.
./scripts/k3d-setup.sh delete

It:

  • requires Docker, k3d, kubectl, and Helm;
  • creates the flow-like k3d cluster and a local registry on host port 5111;
  • builds API, executor, migration, and web images;
  • pushes those images to the local registry;
  • generates a backend JWT keypair;
  • generates helm/values-local.yaml;
  • deploys internal CockroachDB, Redis, the executor pool, web, monitoring, and the API through Helm.

The script does not deploy MinIO. It loads storage from apps/backend/kubernetes/.env and supports aws, azure, gcp, r2, or generic s3. Copy and configure the example first:

Terminal window
cp apps/backend/kubernetes/.env.example \
apps/backend/kubernetes/.env

The generated values-local.yaml contains storage credentials and generated JWT material. It is gitignored; keep it that way.

See Local Development for the full workflow.

deploy.sh creates the namespace if needed and runs helm upgrade --install:

Terminal window
cd apps/backend/kubernetes
./scripts/deploy.sh

Defaults:

NAMESPACE=flow-like
RELEASE=flow-like
VALUES=apps/backend/kubernetes/helm/values.yaml

Override them in the environment and pass additional Helm arguments through:

Terminal window
NAMESPACE=flow-like-staging \
RELEASE=flow-like-staging \
VALUES=/absolute/path/to/values-staging.yaml \
./scripts/deploy.sh --atomic --timeout 10m

The default values.yaml contains placeholder/empty secrets and is not a production secret source. Supply a protected values file or existing Secrets.

This smaller helper builds only:

  • flow-like-k8s-api;
  • flow-like-k8s-executor.
Terminal window
cd apps/backend/kubernetes
REGISTRY=registry.example.com/team \
TAG=2026-07-29 \
PUSH=true \
./scripts/build-images.sh

It does not build the web, compiler, or migration images. The k3d script uses a separate build path and builds web and migration images as well.

Host mode loads apps/backend/kubernetes/.env, builds DATABASE_URL when needed, generates the PostgreSQL Prisma mirror when available, and runs:

prisma db push --accept-data-loss

Run it only after reviewing the target database:

Terminal window
cd apps/backend/kubernetes
./scripts/migrate-db.sh

The script advertises --docker, but that branch runs docker compose run --rm db-migrate from apps/backend/kubernetes. No Compose file or db-migrate service is checked in there, so that mode is currently nonfunctional.

The Helm chart has its own migration Job path; prefer that for chart-managed deployments.

This script creates fixed resources such as flow-like-db, flow-like-s3, flow-like-api-config, and flow-like-executor-config. The current Helm templates do not reference those names, and the script only models its legacy S3 environment shape.

Use Helm values and the chart’s existingSecret options instead. Run setup-config.sh only if you also maintain custom manifests that consume its resources.

dev-bootstrap.sh writes PostgreSQL variables and a DATABASE_URL to apps/backend/kubernetes/.env, then prints docker compose up -d as the next step. dev.sh also starts Compose directly.

There is no apps/backend/kubernetes/docker-compose.yml in the repository, so those next steps do not work in the current tree. Use k3d-setup.sh, or use the separate Docker Compose deployment.