A bundle carries what a cluster would download — llmgw's release with its signed checksums, every llama.cpp build per architecture with GitHub's checksums, model files pinned and checked against Hugging Face's — into a directory or a tar whose manifest sha256 is carried apart. Import checks everything, the release against the signing key, before anything is put in the mirror. With offline.mirror set, nodes install llama.cpp from the mirror against checksums the control plane holds and sends over the agent stream; releases default to the mirror for node add, ctl upgrade and agent upgrades. server init and the setup form install from a bundle. The Helm chart runs one control plane with SQLite on a claim or an external PostgreSQL, Secrets for the agent certificate and admin token, Services, Ingress and ServiceMonitor; deploy/container/Dockerfile builds its image. GPU nodes stay outside Kubernetes, as docs/kubernetes.md explains. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
75 lines
3.0 KiB
Smarty
75 lines
3.0 KiB
Smarty
{{/* The release's name for everything the chart makes. */}}
|
|
{{- define "llmgw.fullname" -}}
|
|
{{- if contains .Chart.Name .Release.Name -}}
|
|
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
|
{{- else -}}
|
|
{{- printf "%s-%s" .Release.Name .Chart.Name | trunc 63 | trimSuffix "-" -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{- define "llmgw.selectorLabels" -}}
|
|
app.kubernetes.io/name: {{ .Chart.Name }}
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
{{- end -}}
|
|
|
|
{{- define "llmgw.labels" -}}
|
|
{{ include "llmgw.selectorLabels" . }}
|
|
app.kubernetes.io/version: {{ .Values.image.tag | default .Chart.AppVersion | quote }}
|
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
|
helm.sh/chart: {{ printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" }}
|
|
{{- end -}}
|
|
|
|
{{- define "llmgw.image" -}}
|
|
{{- if not .Values.image.repository -}}
|
|
{{- fail "image.repository: the image built from deploy/container/Dockerfile, pushed where the cluster can pull it (the project publishes binaries, not an image)" -}}
|
|
{{- end -}}
|
|
{{- printf "%s:%s" .Values.image.repository (.Values.image.tag | default .Chart.AppVersion) -}}
|
|
{{- end -}}
|
|
|
|
{{- define "llmgw.adminSecret" -}}
|
|
{{- .Values.adminToken.existingSecret | default (printf "%s-admin" (include "llmgw.fullname" .)) -}}
|
|
{{- end -}}
|
|
|
|
{{/*
|
|
server.yaml: what the chart decides — listeners, where the certificates,
|
|
the token and the store are mounted — laid over .Values.config. The chart's
|
|
keys win, because each names a port or a path the pod is built around.
|
|
*/}}
|
|
{{- define "llmgw.serverConfig" -}}
|
|
{{- $store := "/var/lib/llmgw/llmgw.db" -}}
|
|
{{- if eq .Values.store.type "postgres" -}}
|
|
{{- $store = "@/etc/llmgw/store/dsn" -}}
|
|
{{- end -}}
|
|
{{- $base := dict
|
|
"listen" ":8080"
|
|
"admin_listen" "127.0.0.1:9090"
|
|
"metrics_listen" ":9091"
|
|
"agent_listen" ":7443"
|
|
"admin_token_file" "/etc/llmgw/admin/admin-token"
|
|
"agent_tls" (dict "ca" "/etc/llmgw/tls/ca.pem" "cert" "/etc/llmgw/tls/server.pem" "key" "/etc/llmgw/tls/server-key.pem")
|
|
"auth" (dict "store" $store)
|
|
-}}
|
|
{{- if .Values.offlineChecksums.configMap -}}
|
|
{{- $_ := set $base "offline" (dict "checksums" "/etc/llmgw/offline/offline.sha256") -}}
|
|
{{- end -}}
|
|
{{- $cfg := mustMergeOverwrite (deepCopy (.Values.config | default dict)) $base -}}
|
|
# Made by the llmgw Helm chart from its values. Every key: docs/reference.md
|
|
{{ toYaml $cfg }}
|
|
{{- end -}}
|
|
|
|
{{/* Refuses values that would make a pod that cannot work. */}}
|
|
{{- define "llmgw.validate" -}}
|
|
{{- if not (has .Values.store.type (list "sqlite" "postgres")) -}}
|
|
{{- fail (printf "store.type %q: sqlite or postgres" .Values.store.type) -}}
|
|
{{- end -}}
|
|
{{- if ne (int .Values.replicas) 1 -}}
|
|
{{- fail "replicas: this chart runs one control plane; values.yaml says why" -}}
|
|
{{- end -}}
|
|
{{- if and (eq .Values.store.type "postgres") (not .Values.store.postgres.existingSecret) -}}
|
|
{{- fail "store.postgres.existingSecret: a Secret holding the PostgreSQL address" -}}
|
|
{{- end -}}
|
|
{{- if not .Values.agentTLS.existingSecret -}}
|
|
{{- fail "agentTLS.existingSecret: a Secret with ca.pem, server.pem and server-key.pem from llmgw's authority (see values.yaml)" -}}
|
|
{{- end -}}
|
|
{{- end -}}
|