Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
53 lines (52 sloc) 1.07 KB
apiVersion: v1
kind: Service
metadata:
name: postgres
spec:
ports:
- port: 5432
targetPort: postgres-client
selector:
app: postgres
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: postgres
labels:
app: postgres
spec:
replicas: 1
template:
metadata:
labels:
app: postgres
spec:
containers:
- image: postgres:9.5
name: postgres
ports:
- name: postgres-client
containerPort: 5432
volumeMounts:
- name: data
mountPath: /var/lib/postgresql/data
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: default
key: pg-password
- name: PGDATA
value: "/var/lib/postgresql/data/pgdata"
volumes:
- name: data
flexVolume:
driver: "5pi.de/do-volume"
fsType: "ext4"
options:
volume: "pgdata"