apiVersion: apps/v1 kind: StatefulSet metadata: namespace: netbox name: netbox-postgres spec: replicas: 1 serviceName: netbox-postgres selector: matchLabels: app: netbox-postgres template: metadata: labels: app: netbox-postgres spec: restartPolicy: Always terminationGracePeriodSeconds: 60 containers: - name: netbox-postgres image: postgres:18 resources: requests: memory: "256Mi" cpu: "100m" limits: memory: "1Gi" cpu: "1000m" ports: - containerPort: 5432 volumeMounts: - name: netbox-postgres-data mountPath: /var/lib/postgresql/data envFrom: - secretRef: name: netbox-postgres-secrets readinessProbe: exec: command: ["sh", "-c", "pg_isready -q -U \"$POSTGRES_USER\" -d \"$POSTGRES_DB\""] initialDelaySeconds: 10 periodSeconds: 10 volumes: - name: netbox-postgres-data persistentVolumeClaim: claimName: netbox-postgres-pvc