feat(deploy): add compose and in-cluster Kind deployment - #30
Conversation
PR Summary by QodoAdd Compose and in-cluster Kind deployment workflows
AI Description
Diagram
High-Level Assessment
Files changed (26)
|
Code Review by Qodo
1.
|
machacekondra
left a comment
There was a problem hiding this comment.
All looks good to me. The only thing is that some files are redudant or similar with what we have in the control-plane repo.
Maybe it's time to think of separating this into e2e repo? Maybe we can have discussion about this.
Sure, we can do the refactoring into separate repo in a follow up PR |
| fi | ||
|
|
||
| echo "==> Applying manifests (image: ${IMAGE})" | ||
| kubectl apply -k "${K8S_DIR}" |
There was a problem hiding this comment.
k8s-deploy.sh builds and loads ${IMAGE} from ENVIRONMENT_AGENT_VERSION, but kubectl apply -k still uses the hardcoded newTag: dev in kustomization. Anything other than dev loads the right image into Kind then schedules :dev.
Prefer kustomize edit set image or kubectl set image
| See [in-cluster.md](docs/in-cluster.md) for full detail. | ||
|
|
||
| ```bash | ||
| kind create cluster --name dcm-local |
There was a problem hiding this comment.
In-cluster quick start uses plain kind create cluster.
On some hosts (Docker Desktop, rootless Podman) neither 127.0.0.1:30081 nor the node InternalIP is reachable, so make k8s-verify fails even when the pod is healthy. Maybe a small Kind config with extraPortMappings for 30081 and 30422? or documentation for port-forward as the fallback?
There was a problem hiding this comment.
added the extraPortMappings config and port-forwards as a fallback in the troubleshooting section - d749d80
|
|
||
| | Variable | Default | Notes | | ||
| |----------|---------|--------| | ||
| | `AGENT_EMBEDDED_SPS` | _(in example)_ | `container`, `vm`, `cluster` | |
There was a problem hiding this comment.
Default column says (in example) but .env.example keeps AGENT_EMBEDDED_SPS commented, which is fine as opt-in. Prefer empty (set in .env) or similar so the table matches the example file.
| # DCM Environment Agent stack (standalone): NATS JetStream + environment-agent. | ||
| # | ||
| # Image version: defaults to :main. Pin with ENVIRONMENT_AGENT_VERSION in deploy/.env. | ||
| # Local dev: `make compose-up` builds the agent from the repo Containerfile. |
There was a problem hiding this comment.
Compose defaults the agent image to :main, k8s-deploy to :dev. Each path builds and tags its own image, so switching from compose to in-cluster does not pick up the image you just built on the other path. Can we use one default tag for both workflows?
There was a problem hiding this comment.
Updated it to default to dev for both workflows. d749d80
| kubeconfig-for-compose: | ||
| ./deploy/scripts/kubeconfig-for-compose.sh |
There was a problem hiding this comment.
make kubeconfig-for-compose runs ./deploy/scripts/kubeconfig-for-compose.sh.
That needs the file to be executable so the target fails with permission denied on a fresh clone.
k8s-host-urls.sh avoids this by calling bash in the Makefile.
Prefer chmod +x here, or invoke via bash like the other scripts.
| - rbac.yaml | ||
| - environment-agent.yaml | ||
|
|
||
| # Image tag should match ENVIRONMENT_AGENT_VERSION in deploy/scripts/k8s-deploy.sh (default: dev). |
There was a problem hiding this comment.
Comment says the tag should match k8s-deploy.sh, but the script never updates this file. Either wire the tag in the script or soften the comment so it does not imply automatic sync.
There was a problem hiding this comment.
Updated the comment
Assisted-By: Cursor AI Signed-off-by: Jennifer Ubah <cju.cipher@gmail.com>
Assisted-By: Cursor AI Signed-off-by: Jennifer Ubah <cju.cipher@gmail.com>
Assisted-By: Cursor AI Signed-off-by: Jennifer Ubah <cju.cipher@gmail.com>
Assisted-By: Cursor AI Signed-off-by: Jennifer Ubah <cju.cipher@gmail.com>
Assisted-By: Cursor AI Signed-off-by: Jennifer Ubah <cju.cipher@gmail.com>
Assisted-By: Cursor AI Signed-off-by: Jennifer Ubah <cju.cipher@gmail.com>
Assisted-By: Cursor AI Signed-off-by: Jennifer Ubah <cju.cipher@gmail.com>
Assisted-By: Cursor AI Signed-off-by: Jennifer Ubah <cju.cipher@gmail.com>
Assisted-By: Cursor AI Signed-off-by: Jennifer Ubah <cju.cipher@gmail.com>
9795922 to
cb85583
Compare
gabriel-farache
left a comment
There was a problem hiding this comment.
I had to change the permisions of the kubeconfig file to 644 instead of 600 as what is set in the kubeconfig-for-compose script to make it work; otherwise I had
{"time":"2026-09-07T18:59:35.38724248Z","level":"ERROR","msg":"failed to setup embedded SPs","error":"container embedded setup: creating container SP app: creating kubernetes client: building kubernetes config: error loading config file \"/kubeconfig\": open /kubeconfig: permission denied"}
Once this and the init script for NATS in the compose file is fixed, it works for me locally
I did not try to send message to the NATS topic of the agent to see
$ make deploy-verify
bash deploy/scripts/verify.sh
==> Agent health (http://localhost:8081)
{"path":"health","status":"healthy"}
==> Registered providers (http://localhost:8081)
{"results":[{"create_time":"2026-09-07T19:08:51.938492438Z","endpoint":"embedded://container","id":"ce25d14c-6b07-4a97-bd5e-bb16698fcc25","last_check_time":"2026-09-07T19:08:51.981157985Z","name":"container","path":"providers/ce25d14c-6b07-4a97-bd5e-bb16698fcc25","schema_version":"v1alpha1","service_type":"container","status":"Unhealthy","type":"embedded","update_time":"2026-09-07T19:08:51.938492438Z"},{"create_time":"2026-09-07T19:08:51.976494151Z","endpoint":"embedded://vm","id":"c94ad4b3-94b8-4d43-a497-dda4edaeff4e","last_check_time":"2026-09-07T19:08:51.98115567Z","name":"vm","path":"providers/c94ad4b3-94b8-4d43-a497-dda4edaeff4e","schema_version":"v1alpha1","service_type":"vm","status":"Unhealthy","type":"embedded","update_time":"2026-09-07T19:08:51.976494151Z"}]}
Assisted-By: Cursor AI Signed-off-by: Jennifer Ubah <cju.cipher@gmail.com>
Thanks for testing this out 🙏🏾 |
Assisted-By: Cursor AI Signed-off-by: Jennifer Ubah <cju.cipher@gmail.com>
Assisted-By: Cursor AI Signed-off-by: Jennifer Ubah <cju.cipher@gmail.com>
Assisted-By: Cursor AI Signed-off-by: Jennifer Ubah <cju.cipher@gmail.com>
Assisted-By: Cursor AI Signed-off-by: Jennifer Ubah <cju.cipher@gmail.com>
Assisted-By: Cursor AI Signed-off-by: Jennifer Ubah <cju.cipher@gmail.com>
Assisted-By: Cursor AI Signed-off-by: Jennifer Ubah <cju.cipher@gmail.com>
| kubectl -n dcm port-forward svc/dcm-nats 4222:4222 | ||
|
|
||
| # Terminal 2 | ||
| export AGENT_URL=http://<node-ip>:30081 # same host as make k8s-verify |
There was a problem hiding this comment.
can <node-ip> be an env var instead? if it is used in several places with env var we make sure it's the same everywhere (typo risk) and it will be easier for the user to just set the env and then copy/paste the command instead of having to update the command with the value
There was a problem hiding this comment.
I refactored this actually and added a command to do the export via the k8-host-urls script. Currently just one place this export with node-ip is used.
| agent) echo "${AGENT_URL}" ;; | ||
| nats) echo "${NATS_URL}" ;; | ||
| export) | ||
| echo "export AGENT_URL=${AGENT_URL}" |
There was a problem hiding this comment.
why removing this one?
There was a problem hiding this comment.
Great catch. This was mistakenly removed when removing the nats probe during testing.
Assisted-By: Cursor AI Signed-off-by: Jennifer Ubah <cju.cipher@gmail.com>
Assisted-By: Cursor AI Signed-off-by: Jennifer Ubah <cju.cipher@gmail.com>
Assisted-By: Cursor AI Signed-off-by: Jennifer Ubah <cju.cipher@gmail.com>
Summary
deploy/compose.yaml) for NATS + environment-agent with Kind helpers pointing to utilities scriptsdeploy/k8s/) withmake k8s-deploy, NodePort access, andk8s-host-urls.shfor verify/publishdeploy/samples/,make publish-creates/make k8s-publish-creates) and deployment docs (DEPLOY.md,compose-kind.md,in-cluster.md)Type of Change
Stacked PR Status
Assisted-By: Cursor AI