Files
Kubernetes-Manifests/applications/netbox/worker/deployment.yaml
T
Jeffrey cfd9317086 netbox: add NetBox 4.6.8 with postgres, valkey and rqworker
Five components under applications/netbox: the web pod, an rqworker,
a daily housekeeping CronJob, postgres 18 and two valkey instances.
The task queue runs appendonly on its own PVC so queued jobs survive a
restart, while the cache instance is disposable.

Worker and cronjob override args rather than command, which replaces
CMD while keeping tini as the entrypoint, so only the web pod runs
migrations. Media, reports and scripts share one RWX PVC via subPaths
because both the web pod and the worker mount them.

Exposed on the internal gateway only.
2026-08-27 20:46:34 +02:00

55 lines
1.4 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
namespace: netbox
name: netbox-worker
spec:
replicas: 1
selector:
matchLabels:
app: netbox-worker
template:
metadata:
labels:
app: netbox-worker
spec:
restartPolicy: Always
terminationGracePeriodSeconds: 60
securityContext:
runAsUser: 999
runAsGroup: 0
fsGroup: 0
containers:
- name: netbox-worker
image: netboxcommunity/netbox:v4.6.8-5.0.2
# Overrides CMD only, so tini stays the entrypoint and migrations
# are left to the web pod.
args:
- /opt/netbox/venv/bin/python
- /opt/netbox/netbox/manage.py
- rqworker
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "1Gi"
cpu: "1000m"
envFrom:
- secretRef:
name: netbox-app-secrets
volumeMounts:
- name: netbox-data
mountPath: /opt/netbox/netbox/media
subPath: media
- name: netbox-data
mountPath: /opt/netbox/netbox/reports
subPath: reports
- name: netbox-data
mountPath: /opt/netbox/netbox/scripts
subPath: scripts
volumes:
- name: netbox-data
persistentVolumeClaim:
claimName: netbox-data-pvc