Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- apiVersion: v1
- kind: PersistentVolume
- metadata:
- name: postgres-pv
- labels:
- type: local
- spec:
- storageClassName: manual
- capacity:
- storage: 5Gi
- accessModes:
- - ReadWriteOnce
- hostPath:
- path: "/tmp/postgress-pv"
- type: DirectoryOrCreate
- ---
- apiVersion: v1
- kind: PersistentVolumeClaim
- metadata:
- name: postgres-pvc
- labels:
- type: local
- spec:
- storageClassName: manual
- accessModes:
- - ReadWriteOnce
- volumeName: postgres-pv
- resources:
- requests:
- storage: 2Gi
- ---
- apiVersion: v1
- kind: ConfigMap
- metadata:
- name: postgres-config
- labels:
- app: postgres
- data:
- POSTGRES_DB: postgres
- POSTGRES_USER: postgres
- POSTGRES_PASSWORD: postgres
- ---
- apiVersion: v1
- kind: Service
- metadata:
- name: postgres
- labels:
- app: postgres
- spec:
- type: NodePort
- ports:
- - port: 5432
- selector:
- app: postgres
- ---
- apiVersion: extensions/v1beta1
- kind: Deployment
- metadata:
- name: postgres
- spec:
- template:
- metadata:
- labels:
- app: postgres
- spec:
- containers:
- - image: "postgres:9.5"
- name: postgres
- imagePullPolicy: "IfNotPresent"
- envFrom:
- - configMapRef:
- name: postgres-config
- ports:
- - containerPort: 5432
- name: postgres
- volumeMounts:
- - name: postgres-storage
- mountPath: /var/lib/postgresql/data
- volumes:
- - name: postgres-storage
- persistentVolumeClaim:
- claimName: postgres-pvc
Add Comment
Please, Sign In to add comment