diff --git a/apps/bookstack/bookstack.yaml b/apps/bookstack/bookstack.yaml new file mode 100644 index 0000000..34d7598 --- /dev/null +++ b/apps/bookstack/bookstack.yaml @@ -0,0 +1,84 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: bookstack-app + namespace: bookstack +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: bookstack + namespace: bookstack +spec: + replicas: 1 + selector: + matchLabels: + app: bookstack + template: + metadata: + labels: + app: bookstack + spec: + containers: + - name: bookstack + image: lscr.io/linuxserver/bookstack:latest + ports: + - containerPort: 80 + env: + - name: PUID + value: "1000" + - name: PGID + value: "1000" + - name: TZ + value: "America/Indiana/Indianapolis" + - name: APP_URL + value: "http://docs.home.lan" + - name: APP_KEY + valueFrom: + secretKeyRef: + name: bookstack-secret + key: APP_KEY + - name: DB_HOST + value: "bookstack-db" + - name: DB_PORT + value: "3306" + - name: DB_DATABASE + valueFrom: + secretKeyRef: + name: bookstack-secret + key: MYSQL_DATABASE + - name: DB_USERNAME + valueFrom: + secretKeyRef: + name: bookstack-secret + key: MYSQL_USER + - name: DB_PASSWORD + valueFrom: + secretKeyRef: + name: bookstack-secret + key: MYSQL_PASSWORD + volumeMounts: + - name: app-data + mountPath: /config + volumes: + - name: app-data + persistentVolumeClaim: + claimName: bookstack-app +--- +apiVersion: v1 +kind: Service +metadata: + name: bookstack + namespace: bookstack +spec: + selector: + app: bookstack + ports: + - port: 80 + targetPort: 80 diff --git a/apps/bookstack/ingress.yaml b/apps/bookstack/ingress.yaml new file mode 100644 index 0000000..184d0d6 --- /dev/null +++ b/apps/bookstack/ingress.yaml @@ -0,0 +1,18 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: bookstack + namespace: bookstack +spec: + ingressClassName: nginx + rules: + - host: docs.home.lan + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: bookstack + port: + number: 80 diff --git a/apps/bookstack/kustomization.yaml b/apps/bookstack/kustomization.yaml new file mode 100644 index 0000000..fdfb0dd --- /dev/null +++ b/apps/bookstack/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - namespace.yaml + - secret.yaml + - mariadb.yaml + - bookstack.yaml + - ingress.yaml diff --git a/apps/bookstack/mariadb.yaml b/apps/bookstack/mariadb.yaml new file mode 100644 index 0000000..e0f44c0 --- /dev/null +++ b/apps/bookstack/mariadb.yaml @@ -0,0 +1,54 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: bookstack-db + namespace: bookstack +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 5Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: bookstack-db + namespace: bookstack +spec: + replicas: 1 + selector: + matchLabels: + app: bookstack-db + template: + metadata: + labels: + app: bookstack-db + spec: + containers: + - name: mariadb + image: mariadb:11 + envFrom: + - secretRef: + name: bookstack-secret + ports: + - containerPort: 3306 + volumeMounts: + - name: db-data + mountPath: /var/lib/mysql + volumes: + - name: db-data + persistentVolumeClaim: + claimName: bookstack-db +--- +apiVersion: v1 +kind: Service +metadata: + name: bookstack-db + namespace: bookstack +spec: + selector: + app: bookstack-db + ports: + - port: 3306 + targetPort: 3306 diff --git a/apps/bookstack/namespace.yaml b/apps/bookstack/namespace.yaml new file mode 100644 index 0000000..990e1d1 --- /dev/null +++ b/apps/bookstack/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: bookstack diff --git a/apps/bookstack/secret.yaml b/apps/bookstack/secret.yaml new file mode 100644 index 0000000..408bcc3 --- /dev/null +++ b/apps/bookstack/secret.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Secret +metadata: + name: bookstack-secret + namespace: bookstack +type: Opaque +stringData: + MYSQL_ROOT_PASSWORD: "ChangeMeRootPassword" + MYSQL_DATABASE: "bookstack" + MYSQL_USER: "bookstack" + MYSQL_PASSWORD: "ChangeMeBookstackPassword" + APP_KEY: "base64:QUUcXvExMqKP6tIw9+TcEjpDxPJIZMX2k0AAbELHtPw="