Files
k8s-manifests/ghost-en/deployment.yaml
chemavxandClaude Opus 4.8 bafbdc8a3b ghost-en: repoint SMTP to Infisical-backed secret (3b)
mail__options__auth__user/pass secretKeyRef
  ghost-en-smtp -> ghost-en-smtp-infisical
Recreate roll picks up the Infisical-synced credentials.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-21 20:06:41 +00:00

143 lines
3.9 KiB
YAML

---
apiVersion: v1
kind: Namespace
metadata:
name: ghost-en
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
# Never let ArgoCD prune this PVC: it holds persistent app data.
argocd.argoproj.io/sync-options: Prune=false
name: ghost-en-content
namespace: ghost-en
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
storageClassName: local-path
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ghost-en
namespace: ghost-en
labels:
app: ghost-en
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: ghost-en
template:
metadata:
labels:
app: ghost-en
spec:
# Stage the GitOps-managed redirects file onto the writable content PVC.
# A ConfigMap volume is always read-only at the FS level, so the Ghost
# entrypoint's `chown -R` on content/ fails ("Read-only file system").
# Copying via an initContainer leaves a normal, chownable file on the PVC,
# refreshed from the ConfigMap (git source of truth) on every pod start.
initContainers:
- name: install-redirects
image: ghost:5-alpine
command:
- sh
- -c
- "mkdir -p /var/lib/ghost/content/data && cp /redirects-src/redirects.yaml /var/lib/ghost/content/data/redirects.yaml"
volumeMounts:
- name: ghost-en-content
mountPath: /var/lib/ghost/content
- name: redirects
mountPath: /redirects-src
readOnly: true
containers:
- name: ghost
image: ghost:5-alpine
ports:
- containerPort: 2368
env:
- name: url
value: "https://www.theexclusionzone.com"
- name: NODE_ENV
value: "production"
- name: database__client
value: "sqlite3"
- name: database__connection__filename
value: "/var/lib/ghost/content/data/ghost.db"
- name: mail__transport
value: "SMTP"
- name: mail__options__service
value: "Gmail"
- name: mail__options__host
value: "smtp.gmail.com"
- name: mail__options__port
value: "465"
- name: mail__options__secureConnection
value: "true"
- name: mail__options__auth__user
valueFrom:
secretKeyRef:
name: ghost-en-smtp-infisical
key: SMTP_USER
- name: mail__options__auth__pass
valueFrom:
secretKeyRef:
name: ghost-en-smtp-infisical
key: SMTP_PASS
- name: privacy__useUpdateCheck
value: "false"
livenessProbe:
httpGet:
path: /ghost/api/v4/admin/site/
port: 2368
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 10
readinessProbe:
httpGet:
path: /ghost/api/v4/admin/site/
port: 2368
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
resources:
requests:
cpu: "50m"
memory: "256Mi"
limits:
cpu: "500m"
memory: "512Mi"
volumeMounts:
- name: ghost-en-content
mountPath: /var/lib/ghost/content
volumes:
- name: ghost-en-content
persistentVolumeClaim:
claimName: ghost-en-content
- name: redirects
configMap:
name: ghost-en-redirects
---
apiVersion: v1
kind: Service
metadata:
name: ghost-en
namespace: ghost-en
spec:
selector:
app: ghost-en
ports:
- port: 2368
targetPort: 2368
protocol: TCP