masterone: k8s manifests for Rancher migration (app+postgres, NodePort 30095)
This commit is contained in:
parent
18800c7046
commit
bfc8dd7809
3 changed files with 188 additions and 0 deletions
84
clusters/default/masterone/10-postgres.yaml
Normal file
84
clusters/default/masterone/10-postgres.yaml
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
# PostgreSQL for the MasterOne portal (hostPath PV — single-node local cluster;
|
||||
# data persists on the host under /root/rancher/data/masterone/postgres).
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: masterone-postgres-pv
|
||||
spec:
|
||||
capacity:
|
||||
storage: 10Gi
|
||||
accessModes: [ReadWriteOnce]
|
||||
hostPath:
|
||||
path: /var/lib/rancher/masterone/postgres
|
||||
type: DirectoryOrCreate
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: masterone-postgres
|
||||
namespace: masterone
|
||||
spec:
|
||||
accessModes: [ReadWriteOnce]
|
||||
volumeName: masterone-postgres-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: postgres
|
||||
namespace: masterone
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: postgres
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: postgres
|
||||
spec:
|
||||
containers:
|
||||
- name: postgres
|
||||
image: postgres:17-alpine
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
env:
|
||||
- name: POSTGRES_DB
|
||||
value: masterone_portal
|
||||
- name: POSTGRES_USER
|
||||
value: masterone
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: masterone-secrets
|
||||
key: POSTGRES_PASSWORD
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
subPath: pgdata
|
||||
readinessProbe:
|
||||
exec:
|
||||
command: ["pg_isready", "-U", "masterone", "-d", "masterone_portal"]
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: masterone-postgres
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: postgres
|
||||
namespace: masterone
|
||||
spec:
|
||||
selector:
|
||||
app: postgres
|
||||
ports:
|
||||
- port: 5432
|
||||
targetPort: 5432
|
||||
Loading…
Add table
Add a link
Reference in a new issue