83 lines
2.4 KiB
YAML
83 lines
2.4 KiB
YAML
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: affine
|
|
namespace: affine
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: affine
|
|
serviceName: affine
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: affine
|
|
spec:
|
|
restartPolicy: Always
|
|
terminationGracePeriodSeconds: 30
|
|
initContainers:
|
|
- name: affine-migration
|
|
image: ghcr.io/toeverything/affine:stable
|
|
command: ["sh", "-c", "node ./scripts/self-host-predeploy.js"]
|
|
env:
|
|
- name: DATABASE_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: affine-secrets
|
|
key: DATABASE_URL
|
|
- name: REDIS_SERVER_HOST
|
|
value: affine-valkey.affine.svc.cluster.local
|
|
- name: AFFINE_INDEXER_ENABLED
|
|
value: "false"
|
|
volumeMounts:
|
|
- name: affine-storage
|
|
mountPath: /root/.affine/storage
|
|
- name: affine-config
|
|
mountPath: /root/.affine/config
|
|
containers:
|
|
- name: affine
|
|
image: ghcr.io/toeverything/affine:stable
|
|
resources:
|
|
requests:
|
|
cpu: 200m
|
|
memory: 512Mi
|
|
limits:
|
|
cpu: 1000m
|
|
memory: 2Gi
|
|
ports:
|
|
- containerPort: 3010
|
|
name: http
|
|
env:
|
|
- name: NODE_ENV
|
|
value: production
|
|
- name: AFFINE_SERVER_HOST
|
|
value: affine.jsme.be
|
|
- name: AFFINE_SERVER_HTTPS
|
|
value: "true"
|
|
- name: AFFINE_SERVER_PORT
|
|
value: "3010"
|
|
- name: AFFINE_INDEXER_ENABLED
|
|
value: "false"
|
|
- name: DATABASE_URL
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: affine-secrets
|
|
key: DATABASE_URL
|
|
- name: REDIS_SERVER_HOST
|
|
value: affine-valkey.affine.svc.cluster.local
|
|
- name: REDIS_SERVER_PORT
|
|
value: "6379"
|
|
volumeMounts:
|
|
- name: affine-storage
|
|
mountPath: /root/.affine/storage
|
|
- name: affine-config
|
|
mountPath: /root/.affine/config
|
|
volumes:
|
|
- name: affine-storage
|
|
persistentVolumeClaim:
|
|
claimName: affine-data-pvc
|
|
- name: affine-config
|
|
persistentVolumeClaim:
|
|
claimName: affine-config-pvc
|