Files
automation/kubernetes-templates/bookstack.yml
T
2026-04-24 06:24:51 +00:00

118 lines
3.0 KiB
YAML

apiVersion: v1
kind: Namespace
metadata:
name: bookstack
---
apiVersion: v1
kind: Secret
metadata:
name: bookstack-secrets
namespace: bookstack
type: Opaque
data:
APP_KEY: YmFzZTY0Ojd2VW8zL2w4SXFRN0w5VTZ5K1cxTTB2WDJaNEg2SjhLOUwwTTFOMk8zUDQ9
DB_PASS: NmtFZlJENUVpVmpqMTA=
---
apiVersion: v1
kind: ConfigMap
metadata:
name: bookstack-config
namespace: bookstack
data:
APP_URL: "https://notes.khongisa.co.za"
DB_HOST: "192.168.1.180"
DB_PORT: "3306"
DB_USER: "bookstack_user"
DB_DATABASE: "bookstackapp"
DRAWIO_URL: "https://drawio.khongisa.co.za/?embed=1&proto=json&spin=1&configure=1"
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: bookstack-app-pvc
namespace: bookstack
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: bookstack
namespace: bookstack
spec:
replicas: 1
selector:
matchLabels:
app: bookstack
template:
metadata:
labels:
app: bookstack
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: DoesNotExist
containers:
- name: bookstack
image: lscr.io/linuxserver/bookstack:latest
ports:
- containerPort: 80
env:
- name: PUID
value: "1000"
- name: PGID
value: "1000"
- name: APP_KEY
valueFrom:
secretKeyRef: { name: bookstack-secrets, key: APP_KEY }
- name: APP_URL
valueFrom:
configMapKeyRef: { name: bookstack-config, key: APP_URL }
- name: DB_HOST
valueFrom:
configMapKeyRef: { name: bookstack-config, key: DB_HOST }
- name: DB_PORT
valueFrom:
configMapKeyRef: { name: bookstack-config, key: DB_PORT }
- name: DB_USER
valueFrom:
configMapKeyRef: { name: bookstack-config, key: DB_USER }
- name: DB_PASS
valueFrom:
secretKeyRef: { name: bookstack-secrets, key: DB_PASS }
- name: DB_DATABASE
valueFrom:
configMapKeyRef: { name: bookstack-config, key: DB_DATABASE }
- name: DRAWIO_URL
valueFrom:
configMapKeyRef: { name: bookstack-config, key: DRAWIO_URL }
volumeMounts:
- name: app-data
mountPath: /config
volumes:
- name: app-data
persistentVolumeClaim:
claimName: bookstack-app-pvc
---
apiVersion: v1
kind: Service
metadata:
name: bookstack-service
namespace: bookstack
spec:
type: NodePort
selector:
app: bookstack
ports:
- protocol: TCP
port: 80
targetPort: 80
nodePort: 33007