Mainflux.mainflux/k8s/mainflux/things-postgres.yml

67 lines
1.4 KiB
YAML

apiVersion: v1
kind: PersistentVolume
metadata:
name: mainflux-things-postgres-data-disk
labels:
name: mainflux-things-postgres-data-disk
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /tmp/data/things-postgres-0
persistentVolumeReclaimPolicy: Recycle
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: mainflux-things-postgres-data-claim
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
apiVersion: v1
kind: Pod
metadata:
name: mainflux-things-postgres
labels:
name: mainflux-things-postgres
spec:
containers:
- name: mainflux-things-postgres
image: postgres:10.2-alpine
env:
- name: POSTGRES_USER
value: "mainflux"
- name: POSTGRES_PASSWORD
value: "mainflux"
- name: POSTGRES_DB
value: "things"
- name: PGDATA
value: /var/lib/postgresql/data/mainflux-things-postgres-data
ports:
- containerPort: 5432
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: mainflux-things-postgres-data
volumes:
- name: mainflux-things-postgres-data
persistentVolumeClaim:
claimName: mainflux-things-postgres-data-claim
---
apiVersion: v1
kind: Service
metadata:
name: mainflux-things-postgres
labels:
name: mainflux-things-postgres
spec:
ports:
- port: 5432
selector:
name: mainflux-things-postgres