Browse Source

deploy anki

main
sseneca 4 months ago
parent
commit
438488bfcc
  1. 50
      clusters/sserver/anki/deployment.yaml
  2. 23
      clusters/sserver/anki/ingress.yaml
  3. 4
      clusters/sserver/anki/namespace.yaml
  4. 14
      clusters/sserver/anki/service.yaml
  5. 34
      clusters/sserver/anki/storage-data.yaml

50
clusters/sserver/anki/deployment.yaml

@ -0,0 +1,50 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: anki
namespace: anki
labels:
app: anki
spec:
replicas: 1
selector:
matchLabels:
app: anki
strategy:
type: Recreate
template:
metadata:
labels:
app: anki
spec:
containers:
- image: kuklinistvan/anki-sync-server:latest
name: anki
ports:
- containerPort: 27701
name: http
env:
- name: ANKISYNCD_HOST
value: "0.0.0.0"
- name: ANKISYNCD_PORT
value: "27701"
- name: ANKISYNCD_DATA_ROOT
value: "./collections"
- name: ANKISYNCD_BASE_URL
value: "/sync/"
- name: ANKISYNCD_BASE_MEDIA_URL
value: "/msync/"
- name: ANKISYNCD_AUTH_DB_PATH
value: "./auth.db"
- name: ANKISYNCD_SESSION_DB_PATH
value: "./session.db"
volumeMounts:
- mountPath: /app/data
name: data
readOnly: false
restartPolicy: Always
volumes:
- name: data
persistentVolumeClaim:
claimName: anki-data
status: {}

23
clusters/sserver/anki/ingress.yaml

@ -0,0 +1,23 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
namespace: anki
name: anki
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
spec:
tls:
- hosts:
- "anki.ssene.ca"
secretName: "anki-tls-cert"
rules:
- host: "anki.ssene.ca"
http:
paths:
- path: /
pathType: ImplementationSpecific
backend:
service:
name: "http"
port:
number: 27701

4
clusters/sserver/anki/namespace.yaml

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

14
clusters/sserver/anki/service.yaml

@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: http
namespace: anki
spec:
ports:
- name: anki
port: 27701
targetPort: 27701
selector:
app: anki
status:
loadBalancer: {}

34
clusters/sserver/anki/storage-data.yaml

@ -0,0 +1,34 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: anki-data
spec:
storageClassName: local-path
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
local:
path: /srv/smb/media/anki-data
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- sserver
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: anki-data
namespace: anki
spec:
storageClassName: local-path
volumeName: anki-data
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
Loading…
Cancel
Save