Files
Verso/server-ce/k8s/verso-prod-data.yaml
T
claude 2d8f23509a
Build and Deploy Verso / deploy (push) Successful in 1m22s
Prod: standalone Deployment/Service bootstrap files; drop namespace create
- Add server-ce/k8s/verso-prod-data.yaml (Mongo + Redis) and
  verso-prod-app.yaml (Verso app), mirroring the workflow so the verso
  namespace can be bootstrapped/validated by hand.
- Drop 'kubectl create namespace verso' from the prod workflow (namespace is
  pre-created), so the runner only needs namespaced rights in verso, matching
  the test namespace.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 12:03:02 +00:00

103 lines
2.4 KiB
YAML

# Data tier for the prod (verso namespace) instance: Mongo + Redis Deployments
# and Services. Identical to what the deploy workflow applies — provided as a
# standalone file so you can bootstrap and validate the namespace before the
# first prod build (and before granting the runner access).
#
# Order:
# 1. kubectl apply -f server-ce/k8s/verso-prod-pvcs.yaml (with storageClass)
# 2. kubectl apply -f server-ce/k8s/verso-prod-data.yaml (this file)
# 3. wait for mongo to be Ready, then initialise the replica set ONCE:
# kubectl -n verso exec deploy/mongo -- mongosh --quiet --eval \
# 'rs.initiate({_id:"rs0",members:[{_id:0,host:"mongo:27017"}]})'
# (the workflow also does this idempotently, so it's optional here)
apiVersion: apps/v1
kind: Deployment
metadata:
name: mongo
namespace: verso
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: mongo
template:
metadata:
labels:
app: mongo
spec:
containers:
- name: mongo
image: mongo:8
command: ["mongod", "--replSet", "rs0", "--bind_ip_all"]
ports:
- containerPort: 27017
volumeMounts:
- name: mongo-data
mountPath: /data/db
volumes:
- name: mongo-data
persistentVolumeClaim:
claimName: mongo-data
---
apiVersion: v1
kind: Service
metadata:
name: mongo
namespace: verso
spec:
selector:
app: mongo
ports:
- name: mongo
port: 27017
targetPort: 27017
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
namespace: verso
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
spec:
containers:
- name: redis
image: redis:7
# AOF persistence so a restart doesn't drop in-flight edits before
# they're flushed to Mongo.
command: ["redis-server", "--appendonly", "yes"]
ports:
- containerPort: 6379
volumeMounts:
- name: redis-data
mountPath: /data
volumes:
- name: redis-data
persistentVolumeClaim:
claimName: redis-data
---
apiVersion: v1
kind: Service
metadata:
name: redis
namespace: verso
spec:
selector:
app: redis
ports:
- name: redis
port: 6379
targetPort: 6379