apiVersion: apps/v1
kind: Deployment
metadata:
  name: bookstack
  namespace: apps
  labels:
    app: bookstack
    openova.io/tenant: "bbb"
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: bookstack
  template:
    metadata:
      labels:
        app: bookstack
        openova.io/tenant: "bbb"
    spec:
      containers:
        - name: bookstack
          image: lscr.io/linuxserver/bookstack:latest
          ports:
            - containerPort: 80
          env:
            - name: WORDPRESS_DB_HOST
              value: "mysql"
            - name: WORDPRESS_DB_USER
              value: "app"
            - name: WORDPRESS_DB_PASSWORD
              value: "bbaa187122d88da6b0e38b8de814c133"
            - name: WORDPRESS_DB_NAME
              value: "db_bookstack"
            - name: MYSQL_HOST
              value: "mysql"
            - name: MYSQL_USER
              value: "app"
            - name: MYSQL_PASSWORD
              value: "bbaa187122d88da6b0e38b8de814c133"
            - name: MYSQL_DATABASE
              value: "db_bookstack"
          resources:
            requests:
              cpu: 100m
              memory: 256Mi
            limits:
              cpu: 500m
              memory: 512Mi
---
apiVersion: v1
kind: Service
metadata:
  name: bookstack
  namespace: apps
spec:
  selector:
    app: bookstack
  ports:
    - port: 80
      targetPort: 80
