Compare commits

...

2 Commits

Author SHA1 Message Date
ab96719964 small fixes 2024-05-15 17:57:15 +02:00
0215ecaf87 add (broken) deployment 2024-05-13 14:27:34 +02:00
7 changed files with 150 additions and 0 deletions

View File

@ -0,0 +1,58 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: affine
spec:
selector:
matchLabels:
app: affine
template:
metadata:
labels:
app: affine
spec:
containers:
- name: affine
image: affine
resources:
limits:
memory: "512Mi"
cpu: "1"
env:
- name: AFFINE_SERVER_HOST
value: "affine.kluster.moll.re"
- name: AFFINE_SERVER_PORT
value: "443"
- name: AFFINE_SERVER_HTTPS
value: "true"
- name: AFFINE_CONFIG_PATH
value: "/root/.affine/config"
- name: AFFINE_ADMIN_EMAIL
value: "me@moll.re"
- name: AFFINE_ADMIN_PASSWORD
value: "password"
- name: TELEMETRY_ENABLE
value: "false"
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: postgres-credentials
key: url
- name: NODE_OPTIONS
value: "--import=./scripts/register.js"
- name: NODE_ENV
value: "production"
ports:
- containerPort: 3010
volumeMounts:
- name: affine-data
mountPath: /root/.affine/storage
- name: affine-config
mountPath: /root/.affine/config
volumes:
- name: affine-data
persistentVolumeClaim:
claimName: affine-data
- name: affine-config
persistentVolumeClaim:
claimName: affine-config

15
apps/affine/ingress.yaml Normal file
View File

@ -0,0 +1,15 @@
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: affine-ingress
spec:
entryPoints:
- websecure
routes:
- match: Host(`affine.kluster.moll.re`)
kind: Rule
services:
- name: affine-web
port: 3010
tls:
certResolver: default-tls

View File

@ -0,0 +1,20 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: affine
resources:
- namespace.yaml
- deployment.yaml
- service.yaml
- ingress.yaml
- postgres.yaml
- pvc.yaml
- postgres-credentials.secret.yaml
images:
- name: affine
newName: ghcr.io/toeverything/affine-graphql
newTag: stable

View File

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: placeholder

20
apps/affine/postgres.yaml Normal file
View File

@ -0,0 +1,20 @@
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: affine-postgres
spec:
instances: 1
bootstrap:
initdb:
owner: affine
database: affine
secret:
name: postgres-credentials
storage:
size: 1Gi
pvcTemplate:
storageClassName: "nfs-client"
resources:
requests:
storage: "1Gi"

23
apps/affine/pvc.yaml Normal file
View File

@ -0,0 +1,23 @@
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: affine-data
spec:
storageClassName: "nfs-client"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 15Gi
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: affine-config
spec:
storageClassName: "nfs-client"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi

10
apps/affine/service.yaml Normal file
View File

@ -0,0 +1,10 @@
apiVersion: v1
kind: Service
metadata:
name: affine-web
spec:
selector:
app: affine
ports:
- port: 3010
targetPort: 3010