Commit Graph

18 Commits (feature/k8s-jobs)

Author SHA1 Message Date
Prathamesh Musale aac317503e fix(test): wait for namespace termination before restart
Replace fixed sleep with a polling loop that waits for the deployment
namespace to be fully deleted. Without this, the start command fails
with 403 Forbidden because k8s rejects resource creation in a
namespace that is still terminating.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 07:01:27 +00:00
Prathamesh Musale b85c12e4da fix(test): use --skip-cluster-management for stop/start volume test
Recreating a kind cluster in the same CI run fails due to stale
etcd/certs and cgroup detection issues. Use --skip-cluster-management
to reuse the existing cluster, and --delete-volumes to clear PVs so
fresh PVCs can bind on restart.

The volume retention semantics are preserved: bind-mount host path
data survives (filesystem is old), provisioner volumes are fresh
(PVs were deleted).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 06:49:42 +00:00
Prathamesh Musale a1b5220e40 fix(test): prevent set -e from killing kubectl queries in test checks
kubectl commands that query jobs or pod specs exit non-zero when the
resource doesn't exist yet. Under set -e, a bare command substitution
like var=$(kubectl ...) aborts the script silently. Add || true so
the polling loop and assertion logic can handle failures gracefully.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 05:59:35 +00:00
Prathamesh Musale 464215c72a fix(test): replace empty secrets key instead of appending duplicate
deploy init already writes 'secrets: {}' into the spec file. The test
was appending a second secrets block via heredoc, which ruamel.yaml
rejects as a duplicate key. Use sed to replace the empty value instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 05:34:37 +00:00
Prathamesh Musale 108f13a09b fix(test): wait for kind cluster cleanup before recreating
Replace the fixed `sleep 20` with a polling loop that waits for
`kind get clusters` to report no clusters. The previous approach
was flaky on CI runners where Docker takes longer to tear down
cgroup hierarchies after `kind delete cluster`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 05:26:48 +00:00
Prathamesh Musale d64046df55 Revert "fix(test): reuse kind cluster on stop/start cycle in deploy test"
This reverts commit 35f179b755.
2026-03-10 05:24:00 +00:00
Prathamesh Musale 35f179b755 fix(test): reuse kind cluster on stop/start cycle in deploy test
Use --skip-cluster-management to avoid destroying and recreating the
kind cluster during the stop/start volume retention test. The second
kind create fails on some CI runners due to cgroups detection issues.

Use --delete-volumes to clear PVs so fresh PVCs can bind on restart.
Bind-mount data survives on the host filesystem; provisioner volumes
are recreated fresh.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 05:13:26 +00:00
Prathamesh Musale 1375f209d3 test(k8s): add tests for jobs, secrets, labels, and namespace isolation
Add a job compose file for the test stack and extend the k8s deploy
test to verify new features:
- Namespace isolation: pod exists in laconic-{id}, not default
- Stack labels: app.kubernetes.io/stack label set on pods
- Job completion: test-job runs to completion (status.succeeded=1)
- Secrets: spec secrets: key results in envFrom secretRef on pod

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 05:06:31 +00:00
Thomas E Lackey 65d67dba10 Fix k8s and enable it by default on PRs (#742)
Publish / Build and publish (push) Successful in 52s Details
Smoke Test / Run basic test suite (push) Successful in 3m45s Details
Lint Checks / Run linter (push) Failing after 3s Details
Deploy Test / Run deploy test suite (push) Successful in 3m32s Details
K8s Deploy Test / Run deploy test suite on kind/k8s (push) Failing after 1m2s Details
Webapp Test / Run webapp test suite (push) Successful in 3m22s Details
Reviewed-on: https://git.vdb.to/cerc-io/stack-orchestrator/pulls/742
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2024-02-14 23:50:09 +00:00
Thomas E Lackey b22c72e715 For k8s, use provisioner-managed volumes when an absolute host path is not specified. (#741)
In kind, when we bind-mount a host directory it is first mounted into the kind container at /mnt, then into the pod at the desired location.

We accidentally picked this up for full-blown k8s, and were creating volumes at /mnt.  This changes the behavior for both kind and regular k8s so that bind mounts are only allowed if a fully-qualified path is specified.  If no path is specified at all, a default storageClass is assumed to be present, and the volume managed by a provisioner.

Eg, for kind, the default provisioner is: https://github.com/rancher/local-path-provisioner

```
stack: test
deploy-to: k8s-kind
config:
  test-variable-1: test-value-1
network:
  ports:
    test:
     - '80'
volumes:
  # this will be bind-mounted to a host-path
  test-data-bind: /srv/data
  # this will be managed by the k8s node
  test-data-auto:
configmaps:
  test-config: ./configmap/test-config
```

Reviewed-on: https://git.vdb.to/cerc-io/stack-orchestrator/pulls/741
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2024-02-14 21:45:01 +00:00
David Boreham 8be1e684e8 Process environment variables defined in compose files (#736)
Reviewed-on: https://git.vdb.to/cerc-io/stack-orchestrator/pulls/736
Co-authored-by: David Boreham <david@bozemanpass.com>
Co-committed-by: David Boreham <david@bozemanpass.com>
2024-02-08 19:41:57 +00:00
Thomas E Lackey 36bb068983
Add ConfigMap test. (#726)
Publish / Build and publish (push) Successful in 1m24s Details
Deploy Test / Run deploy test suite (push) Successful in 2m52s Details
K8s Deploy Test / Run deploy test suite on kind/k8s (push) Failing after 1m3s Details
Webapp Test / Run webapp test suite (push) Successful in 2m40s Details
Smoke Test / Run basic test suite (push) Successful in 4m24s Details
* Add ConfigMap test.

* eof

* Minor tweak

* Trigger test

---------

Co-authored-by: David Boreham <david@bozemanpass.com>
2024-02-05 14:15:11 -06:00
David Boreham a750b645b9
Merge Ci test branch fixes (#717) 2024-01-30 11:18:08 -07:00
David Boreham b7f215d9bf
k8s test fixes (#713)
Publish / Build and publish (push) Successful in 51s Details
Deploy Test / Run deploy test suite (push) Successful in 3m2s Details
K8s Deploy Test / Run deploy test suite on kind/k8s (push) Failing after 1m3s Details
Webapp Test / Run webapp test suite (push) Successful in 2m34s Details
Smoke Test / Run basic test suite (push) Successful in 3m48s Details
* Add cgroup setup, increase test timeouts

* Trigger from test script or CI job changes too
2024-01-28 16:21:39 -07:00
David Boreham 635aa7037b Build test container 2024-01-16 21:15:21 -07:00
David Boreham 1f9653e6f7
Fix kind mode and add k8s deployment test (#704)
* Fix kind mode and add k8s deployment test

* Fix lint errors
2024-01-16 15:55:58 -07:00
David Boreham c9c6a0eee3
Changes for remote k8s (#655)
Publish / Build and publish (push) Successful in 1m2s Details
Deploy Test / Run deploy test suite (push) Successful in 3m6s Details
K8s Deploy Test / Run deploy test suite (push) Failing after 3m4s Details
Webapp Test / Run webapp test suite (push) Failing after 3m36s Details
Smoke Test / Run basic test suite (push) Successful in 4m4s Details
2023-11-20 09:12:57 -07:00
David Boreham a27cf86748
Add basic k8s test (#635)
* Add CI job

* Add basic k8s test
2023-11-08 19:12:48 -07:00