apiVersion: batch/v1 kind: Job metadata: name: {{ include "llm-app.fullname" . }}-smoketest annotations: "helm.sh/hook": post-install,post-upgrade "helm.sh/hook-weight": "10" "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded spec: backoffLimit: 2 activeDeadlineSeconds: 240 ttlSecondsAfterFinished: 600 template: spec: restartPolicy: Never containers: - name: curl image: curlimages/curl:8.10.1 command: ["/bin/sh", "-euc"] args: - | ENDPOINT="http://{{ include "llm-app.fullname" . }}:{{ .Values.service.port }}" MODEL={{ .Values.model.alias | quote }} echo "smoketest: GET $ENDPOINT/v1/models" out=$(curl -fsS --max-time 60 "$ENDPOINT/v1/models") echo "$out" | grep -q "\"$MODEL\"" || { echo "FAIL: $MODEL not listed in /v1/models"; echo "$out"; exit 1; } echo "smoketest: POST $ENDPOINT/v1/chat/completions" resp=$(curl -fsS --max-time 90 "$ENDPOINT/v1/chat/completions" \ -H "Content-Type: application/json" \ -d "{\"model\":\"$MODEL\",\"messages\":[{\"role\":\"user\",\"content\":\"Reply with just: pong\"}],\"max_tokens\":8,\"temperature\":0}") echo "$resp" | grep -q '"content"' || { echo "FAIL: no content in response"; echo "$resp"; exit 1; } echo "OK"