mirror of
https://github.com/Noratrieb/vps.git
synced 2026-01-15 09:05:10 +01:00
65 lines
1.3 KiB
YAML
65 lines
1.3 KiB
YAML
# https://www.containiq.com/post/deploy-postgres-on-kubernetes
|
|
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: hugo-chat-db-config
|
|
data:
|
|
POSTGRES_PASSWORD: huGO123.corsBOSS
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: hugo-chat-db-volume-claim
|
|
spec:
|
|
storageClassName: local-storage
|
|
resources:
|
|
requests:
|
|
storage: 100Mi
|
|
volumeMode: Filesystem
|
|
accessModes:
|
|
- ReadWriteMany
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: hugo-chat-db
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
app: hugo-chat-db
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: hugo-chat-db
|
|
spec:
|
|
containers:
|
|
- name: hugo-chat-db
|
|
image: docker.io/postgres:latest
|
|
resources:
|
|
limits:
|
|
memory: "256Mi"
|
|
cpu: "500m"
|
|
envFrom:
|
|
- configMapRef:
|
|
name: hugo-chat-db-config
|
|
volumeMounts:
|
|
- mountPath: /var/lib/postgresql/data
|
|
name: postgredb
|
|
ports:
|
|
- containerPort: 5432
|
|
volumes:
|
|
- name: postgredb
|
|
persistentVolumeClaim:
|
|
claimName: hugo-chat-db-volume-claim
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: hugo-chat-db-service
|
|
spec:
|
|
selector:
|
|
app: hugo-chat-db
|
|
ports:
|
|
- port: 5432
|
|
targetPort: 5432
|