create postgres config
This commit is contained in:
parent
b22b5e5c76
commit
b662a9cc59
87
postgres.yaml
Normal file
87
postgres.yaml
Normal file
@ -0,0 +1,87 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: birbnetes-nfs-input-postgres
|
||||
namespace: birbnetes
|
||||
spec:
|
||||
capacity:
|
||||
storage: 10Gi
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
persistentVolumeReclaimPolicy: Recycle
|
||||
nfs:
|
||||
server: 192.168.100.1
|
||||
path: /srv/kubedata/birbnetes/input_postgres
|
||||
---
|
||||
kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: input-postgres-pv-claim
|
||||
labels:
|
||||
app: input-postgres
|
||||
namespace: birbnetes
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: input-postgres-config
|
||||
labels:
|
||||
app: input-postgres
|
||||
namespace: birbnetes
|
||||
data:
|
||||
POSTGRES_DB: input-service
|
||||
POSTGRES_USER: input-service
|
||||
POSTGRES_PASSWORD: input-service-supersecret
|
||||
PGDATA: /var/lib/postgresql/data/pgdata
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: input-postgres
|
||||
namespace: birbnetes
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: input-postgres
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: input-postgres
|
||||
spec:
|
||||
containers:
|
||||
- name: input-postgres
|
||||
image: postgres:12
|
||||
imagePullPolicy: "IfNotPresent"
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
envFrom:
|
||||
- configMapRef:
|
||||
name: input-postgres-config
|
||||
volumeMounts:
|
||||
- mountPath: /var/lib/postgresql/data
|
||||
name: input-postgredb
|
||||
volumes:
|
||||
- name: input-postgredb
|
||||
persistentVolumeClaim:
|
||||
claimName: input-postgres-pv-claim
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: input-postgres
|
||||
namespace: birbnetes
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 5432
|
||||
targetPort: 5432
|
||||
protocol: TCP
|
||||
selector:
|
||||
app: input-postgres
|
Loading…
Reference in New Issue
Block a user