add app, add nfs operator
This commit is contained in:
@@ -25,3 +25,62 @@ spec:
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 80
|
||||
---
|
||||
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
namespace: myapp
|
||||
labels:
|
||||
app: myapp-psql
|
||||
name: myapp-psql
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: myapp-psql
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: myapp-psql
|
||||
spec:
|
||||
hostname: myapp-psql-pod
|
||||
restartPolicy: Always
|
||||
containers:
|
||||
- name: myapp-db
|
||||
image: postgres:12-alpine
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: POSTGRES_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: myapp-psql-secret
|
||||
key: postgress-user
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: myapp-psql-secret
|
||||
key: postgress-password
|
||||
- name: POSTGRES_DB
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: myapp-psql-secret
|
||||
key: postgress-dbname
|
||||
volumeMounts:
|
||||
- name: vol-myapp-postgres
|
||||
mountPath: /var/lib/postgresql/data
|
||||
subPath: data
|
||||
- name: pgsql-tmpfs
|
||||
mountPath: /run
|
||||
- name: pgsql-tmpfs
|
||||
mountPath: /tmp
|
||||
|
||||
volumes:
|
||||
- name: vol-myapp-postgres
|
||||
persistentVolumeClaim:
|
||||
claimName: myapp-db-pvc
|
||||
- name: pgsql-tmpfs
|
||||
emptyDir:
|
||||
medium: Memory
|
||||
|
Reference in New Issue
Block a user