91 lines
2.3 KiB
YAML
91 lines
2.3 KiB
YAML
# Postgres 16 + pgvector para el corpus (namespace roswell).
|
|
# El Secret roswell-pg-secret se crea imperativamente (PLAN Fase 6);
|
|
# migración a Infisical preparada en infisical-roswell-secrets.yaml.
|
|
# ClusterIP (cierre Fase 6): con el bot ya en el clúster el NodePort 30432
|
|
# sobraba. Acceso local puntual: desde un nodo del clúster la ClusterIP
|
|
# responde directa; desde fuera, kubectl port-forward -n roswell svc/postgres 15432:5432.
|
|
apiVersion: v1
|
|
kind: Namespace
|
|
metadata:
|
|
name: roswell
|
|
---
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
annotations:
|
|
# ArgoCD no debe podar nunca este PVC: contiene la BD del corpus.
|
|
argocd.argoproj.io/sync-options: Prune=false
|
|
name: roswell-pgdata
|
|
namespace: roswell
|
|
spec:
|
|
accessModes: ["ReadWriteOnce"]
|
|
resources:
|
|
requests:
|
|
storage: 20Gi
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: postgres
|
|
namespace: roswell
|
|
spec:
|
|
replicas: 1
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
app: roswell-postgres
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: roswell-postgres
|
|
spec:
|
|
containers:
|
|
- name: postgres
|
|
image: pgvector/pgvector:pg16
|
|
env:
|
|
- name: POSTGRES_DB
|
|
value: roswell
|
|
- name: POSTGRES_USER
|
|
value: roswell
|
|
- name: POSTGRES_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: roswell-pg-secret-infisical
|
|
key: password
|
|
- name: PGDATA
|
|
value: /var/lib/postgresql/data/pgdata
|
|
ports:
|
|
- containerPort: 5432
|
|
volumeMounts:
|
|
- name: pgdata
|
|
mountPath: /var/lib/postgresql/data
|
|
resources:
|
|
requests:
|
|
memory: 256Mi
|
|
cpu: 100m
|
|
limits:
|
|
memory: 1Gi
|
|
readinessProbe:
|
|
exec:
|
|
command: ["pg_isready", "-U", "roswell", "-d", "roswell"]
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 5
|
|
volumes:
|
|
- name: pgdata
|
|
persistentVolumeClaim:
|
|
claimName: roswell-pgdata
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: postgres
|
|
namespace: roswell
|
|
spec:
|
|
type: ClusterIP
|
|
selector:
|
|
app: roswell-postgres
|
|
ports:
|
|
- port: 5432
|
|
targetPort: 5432
|