init: web portal
Some checks failed
Build and Push Images / build-backend (push) Has been cancelled

This commit is contained in:
qorgh529
2026-04-06 21:16:17 +09:00
commit 5e7e245858
21 changed files with 1717 additions and 0 deletions

65
k8s/02-postgres.yaml Executable file
View File

@@ -0,0 +1,65 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-pvc
namespace: web-portal
spec:
accessModes: [ReadWriteOnce]
resources:
requests:
storage: 1Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
namespace: web-portal
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:15-alpine
env:
- name: POSTGRES_DB
value: portaldb
- name: POSTGRES_USER
value: portaluser
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: portal-secrets
key: db-password
ports:
- containerPort: 5432
volumeMounts:
- name: postgres-data
mountPath: /var/lib/postgresql/data
readinessProbe:
exec:
command: [pg_isready, -U, portaluser, -d, portaldb]
initialDelaySeconds: 5
periodSeconds: 5
volumes:
- name: postgres-data
persistentVolumeClaim:
claimName: postgres-pvc
---
apiVersion: v1
kind: Service
metadata:
name: postgres-service
namespace: web-portal
spec:
selector:
app: postgres
ports:
- port: 5432
targetPort: 5432