nuthatch/tests/kind/wp12-health.yaml.in

39 lines
1.3 KiB
YAML
Raw Normal View History

apiVersion: batch/v1
kind: Job
metadata:
name: @@JOB_NAME@@
namespace: nuthatch-testbed
spec:
activeDeadlineSeconds: 60
backoffLimit: 0
template:
spec:
automountServiceAccountToken: false
enableServiceLinks: false
restartPolicy: Never
containers:
- name: health
image: @@CURL_IMAGE@@
imagePullPolicy: Never
command: [/bin/sh, -ec]
args:
- |
base="https://nuthatch-@@LANE@@:8080"
test "$(
curl --insecure --silent --output /tmp/health \
--write-out '%{http_code}' "$base/healthz"
)" = 200
grep -F '"ok":true' /tmp/health
test "$(
curl --insecure --silent --output /tmp/ready \
--write-out '%{http_code}' "$base/readyz"
)" = "@@READY_STATUS@@"
curl --insecure --silent --output /dev/null "$base/app"
test "$(
curl --insecure --silent --output /dev/null \
--write-out '%{http_code}' "$base/api/session"
)" = 303
printf 'runtime health semantics passed\n'
resources:
requests: {cpu: 25m, memory: 16Mi}
limits: {cpu: 250m, memory: 64Mi}