Loup
11/26/2025, 10:04 PMMarvin
11/26/2025, 10:05 PMMarvin
11/26/2025, 10:08 PMserver:
resources:
requests:
cpu: 500m
memory: 512Mi
limits:
cpu: "1"
memory: 1Gi
backgroundServices:
resources:
requests:
cpu: 500m
memory: 512Mi
limits:
cpu: "1"
memory: 1Gi
- Worker resources (values.yaml)
worker:
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: "1"
memory: 1Gi
Common K3s gotchas that cause server crashes
- OOMKilled: the most frequent cause. Check kubectl describe pod for OOMKilled and bump memory limits/requests as above.
- CPU starvation/throttling: K3s nodes with 1 vCPU often throttle; set a proper CPU request so the scheduler reserves it.
- SQLite with multiple replicas: use Postgres if you scale server replicas beyond 1.
- DB connection pool too large for tiny Postgres: reduce pool if you’re very resource constrained:
PREFECT_SERVER_DATABASE_SQLALCHEMY_POOL_SIZE=3
PREFECT_SERVER_DATABASE_SQLALCHEMY_MAX_OVERFLOW=5
- Ingress / service misconfig: workers must reach PREFECT_API_URL (test with curl from a worker pod).
Fast debug checklist
1) Describe the crashing pod
kubectl describe pod <prefect-server-pod>
kubectl logs <prefect-server-pod> -c server
kubectl logs <prefect-server-pod> -c services
- Look for OOMKilled, CrashLoopBackOff, or db connection errors.
2) Verify DB is reachable and healthy (pods up, PVC size, logs show success).
3) Confirm worker API URL/Key
echo $PREFECT_API_URL
echo $PREFECT_API_KEY
4) From a worker pod, test reachability
apk add curl || apt-get update && apt-get install -y curl
curl -sS <your-api-url>/api/health
If you want an even leaner K3s profile to try first (single-node dev/test)
server:
resources:
requests: { cpu: 200m, memory: 256Mi }
limits: { cpu: 500m, memory: 512Mi }
backgroundServices:
resources:
requests: { cpu: 200m, memory: 256Mi }
limits: { cpu: 500m, memory: 512Mi }
But if you see any OOMKilled, jump to 512Mi requests / 1Gi limits immediately.
Cluster sizing guidance (smallest workable)
- Single-node K3s dev box: at least 2 vCPU and 2–4 GiB free for Prefect + Postgres
- HA or heavier use: 8–12 GiB RAM cluster-wide and 4–6 vCPU
Useful references
- Helm charts (server + worker): prefect-helm
- Server chart values: prefect-server/values.yaml
- Worker chart values: prefect-worker/values.yaml
If you can share:
- How you deployed (Helm chart version/values or manifests)
- k describe/k logs from the crashing server pod
- Node resources (CPU/RAM), and whether you’re using Postgres or SQLite
…I can pinpoint exactly why the server is crashing and give you a tuned values.yaml for your cluster.Loup
11/26/2025, 10:14 PMapiVersion: <http://argoproj.io/v1alpha1|argoproj.io/v1alpha1>
kind: Application
metadata:
name: prefect
namespace: argocd
spec:
project: default
sources:
- repoURL: <https://prefecthq.github.io/prefect-helm>
chart: prefect-server
targetRevision: 2025.11.21180339
helm:
valuesObject:
server:
replicaCount: 1
basicAuth:
enabled: true
existingSecret: "prefect-auth-secret"
uiConfig:
prefectUiApiUrl: "<https://prefect.recomend.app/api>"
env:
- name: PREFECT_SERVER_API_CSRF_PROTECTION_ENABLED
value: "true"
postgresql:
enabled: true
primary:
persistence:
enabled: true
storageClass: hcloud-volumes
size: 10Gi
annotations:
<http://resize.topolvm.io/storage_limit|resize.topolvm.io/storage_limit>: "50Gi"
<http://resize.topolvm.io/threshold|resize.topolvm.io/threshold>: "20%"
<http://resize.topolvm.io/increase|resize.topolvm.io/increase>: "25%"
<http://backup.velero.io/backup-volumes|backup.velero.io/backup-volumes>: "data"
- repoURL: <https://prefecthq.github.io/prefect-helm>
chart: prefect-worker
targetRevision: 2025.11.21180339
helm:
valuesObject:
worker:
apiConfig: selfHostedServer
config:
workPool: kube
baseJobTemplate:
existingConfigMapName: prefect-base-job-template
selfHostedServerApiConfig:
apiUrl: "<http://prefect-server.prefect.svc.cluster.local:4200/api>"
basicAuth:
enabled: true
existingSecret: "prefect-auth-secret"
- repoURL: <https://github.com/recomendapp/infra.git>
targetRevision: main
path: apps/services/prefect
directory:
recurse: true
destination:
server: <https://kubernetes.default.svc>
namespace: prefect
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
- ServerSideApply=true
How can I set minimum ressources to the server ?Marvin
11/26/2025, 10:14 PMMarvin
11/26/2025, 10:16 PMserver.resources block under the prefect-server source.
Example (safe minimum for k3s; bump if you see OOMKilled):
sources:
- repoURL: <https://prefecthq.github.io/prefect-helm>
chart: prefect-server
targetRevision: 2025.11.21180339
helm:
valuesObject:
server:
replicaCount: 1
resources:
requests:
cpu: 500m
memory: 512Mi
limits:
cpu: "1"
memory: 1Gi
basicAuth:
enabled: true
existingSecret: "prefect-auth-secret"
uiConfig:
prefectUiApiUrl: "<https://prefect.recomend.app/api>"
env:
- name: PREFECT_SERVER_API_CSRF_PROTECTION_ENABLED
value: "true"
If you’re extremely constrained and just testing, you can try a leaner profile (expect to bump if pods get OOMKilled):
server:
resources:
requests:
cpu: 200m
memory: 256Mi
limits:
cpu: 500m
memory: 512Mi
If you enable background services as a separate deployment, also set their resources:
backgroundServices:
runAsSeparateDeployment: true
resources:
requests:
cpu: 200–500m
memory: 256–512Mi
limits:
cpu: 500m–1
memory: 512Mi–1Gi
Optional (migration job):
migrations:
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 256Mi
Links to chart values for reference:
- Server chart values: prefect-server/values.yaml
- Worker chart values: prefect-worker/values.yaml
Tip: after syncing, if the server still crashes, run kubectl describe pod on the server pod to check for OOMKilled; if so, raise the memory limit to 1–2Gi.