Files
cluster-knaster/deploy/k8s/llamacpp/llamacpp.yaml.j2
Robert RappandClaude Fable 5.1 15e36e945e
ci / test (push) Failing after 22s
k3s llama.cpp: Proben mit timeoutSeconds, Vorfall 27.–29.10. (Chat-Pod in Neustartschleife, Hindsight-Retain)
Liveness-/Readiness-Probe liefen mit dem Standard-Timeout von 1 s. Während der
Prompt-Verarbeitung (ein Slot auf der P2000, Hindsight-Extraktionsprompt ab
3.500 Token) antwortet /health verzögert, drei Fehlproben in 90 s ließen kubelet
den Container beenden (Exit 139, 50 Neustarts in 8 Tagen). Über LiteLLM kamen
daraus leere 400/500 für hindsight-llm, jeder Retain scheiterte und löste per
Wiederholung den nächsten Neustart aus.

- llamacpp.yaml.j2: timeoutSeconds 10 s und failureThreshold 6 für Readiness
  und Liveness, Start-Probe 5 s
- known-issues.md: Falle beschrieben
- BETRIEB §14: Vorfall mit Diagnoseweg

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-29 19:28:32 +01:00

70 lines
3.2 KiB
Django/Jinja
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# llama.cpp-Server je GPU-VM in k3s (Task 6.1, D6), gerendert von der Rolle gpu-llamacpp (tasks/k3s.yml) je Knoten.
# Ein Pod je Knoten; im Profil embed laufen Embedding und Rerank als zwei Container auf derselben P2000.
# Kartenwahl: kein nvidia.com/gpu (das Device Plugin verwaltet nur die M4000, Index 0), sondern die UUID der P2000
# per NVIDIA_VISIBLE_DEVICES, ermittelt und geprüft über den Kartennamen (ADR-0006: M4000 bleibt frei).
# Host-Netz mit den Ports wie zuvor im Compose (8080/8081/8082): Prometheus-Ziele (file_sd) und ufw bleiben gültig.
# Image aus dem Compose-Build, in das containerd von k3s importiert (imagePullPolicy Never).
# Datenschutz wie im Compose: kein --verbose, /slots aus, keine Web-Oberfläche.
apiVersion: apps/v1
kind: Deployment
metadata:
name: llamacpp-{{ inventory_hostname }}
namespace: knaster
labels: {app: llamacpp, knaster.node: {{ inventory_hostname }}}
spec:
replicas: 1
strategy: {type: Recreate} # Host-Ports und VRAM der P2000 können nur einmal belegt sein
selector:
matchLabels: {app: llamacpp, knaster.node: {{ inventory_hostname }}}
template:
metadata:
labels: {app: llamacpp, knaster.node: {{ inventory_hostname }}}
spec:
runtimeClassName: nvidia
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
nodeSelector:
kubernetes.io/hostname: {{ inventory_hostname }}
containers:
{% for svc in llamacpp_k3s_containers %}
- name: {{ svc.name }}
image: {{ llamacpp_image }}
imagePullPolicy: Never
args: {{ svc.args | to_json }}
env:
- {name: NVIDIA_VISIBLE_DEVICES, value: "{{ llamacpp_gpu_env[svc.gpu_var] }}"}
- {name: NVIDIA_DRIVER_CAPABILITIES, value: "compute,utility"}
resources:
requests: {cpu: 500m, memory: 1Gi}
limits: {memory: {{ svc.memory_limit }}}
securityContext:
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
volumeMounts:
- {name: models, mountPath: /models, readOnly: true}
- {name: tmp, mountPath: /tmp}
# timeoutSeconds: der Standard (1 s) reicht nicht – während der Prompt-Verarbeitung (ein Slot, P2000) antwortet
# /health mehrere Sekunden verzögert; mit 1 s schlugen drei Proben in Folge fehl und kubelet beendete den
# Chat-Container mitten im Retain (29.10.: 50 Neustarts in 8 Tagen, Exit 139 „terminate called“). Siehe BETRIEB §14.
startupProbe:
httpGet: {path: /health, port: {{ svc.port }}, host: 127.0.0.1}
periodSeconds: 5
timeoutSeconds: 5
failureThreshold: 60
readinessProbe:
httpGet: {path: /health, port: {{ svc.port }}, host: 127.0.0.1}
periodSeconds: 30
timeoutSeconds: 10
failureThreshold: 6
livenessProbe:
httpGet: {path: /health, port: {{ svc.port }}, host: 127.0.0.1}
periodSeconds: 30
timeoutSeconds: 10
failureThreshold: 6
{% endfor %}
volumes:
- name: models
hostPath: {path: {{ llamacpp_models_dir }}, type: Directory}
- name: tmp
emptyDir: {sizeLimit: 64Mi}