netbox-docker/kubernetes/postgres.yaml

68 lines
1.2 KiB
YAML

---
apiVersion: v1
kind: ConfigMap
metadata:
name: netbox-postgres-env
data:
POSTGRES_DB: netbox
POSTGRES_USER: netbox
---
apiVersion: v1
kind: Secret
metadata:
name: netbox-postgres-secrets
type: Opaque
data:
POSTGRES_PASSWORD: SjVickhyb2RqZHU0aWYwSw== # echo -n 'J5brHrodjdu4if0K' | base64
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: netbox-postgres
labels:
backend: postgres
app: netbox
spec:
replicas: 1
revisionHistoryLimit: 2
strategy:
type: Recreate
selector:
matchLabels:
backend: postgres
app: netbox
template:
metadata:
labels:
backend: postgres
app: netbox
spec:
restartPolicy: Always
containers:
- image: postgres:9.6-alpine
name: postgres
ports:
- containerPort: 5432
envFrom:
- secretRef:
name: netbox-postgres-secrets
- configMapRef:
name: netbox-postgres-env
---
apiVersion: v1
kind: Service
metadata:
name: netbox-postgres
labels:
backend: postgres
app: netbox
spec:
clusterIP: None
ports:
- name: headless
port: 5432
targetPort: 5432
selector:
backend: postgres
app: netbox