Adding a basic kubernetes example.
This commit is contained in:
parent
c231aa97a1
commit
df9bc3886a
4 changed files with 301 additions and 0 deletions
67
kubernetes/postgres.yaml
Normal file
67
kubernetes/postgres.yaml
Normal file
|
@ -0,0 +1,67 @@
|
|||
---
|
||||
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
|
Loading…
Add table
Add a link
Reference in a new issue