apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    app: iteam-ghost
  name: iteam-ghost
  namespace: iteam-se
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: iteam-ghost
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: iteam-ghost
    spec:
      containers:
        - env:
            - name: ALLOW_EMPTY_PASSWORD
              value: "yes"
            - name: MARIADB_HOST
              value: iteam-ghost-mariadb
            - name: MARIADB_PORT_NUMBER
              value: "3306"
            - name: GHOST_DATABASE_NAME
              value: bitnami_ghost
            - name: GHOST_DATABASE_USER
              value: bn_ghost
            - name: GHOST_DATABASE_PASSWORD
              valueFrom:
                secretKeyRef:
                  key: mariadb-password
                  name: mariadb-password
            - name: GHOST_HOST
              value: iteam-se.iteamdev.io/
            - name: GHOST_PROTOCOL
              value: https
            - name: GHOST_PORT_NUMBER
              value: "443"
            - name: GHOST_USERNAME
              value: christian.landgren@iteam.se
            - name: GHOST_PASSWORD
              valueFrom:
                secretKeyRef:
                  key: ghost-password
                  name: iteam-ghost
            - name: GHOST_EMAIL
              value: christian.landgren@iteam.se
            - name: BLOG_TITLE
              value: Iteam
          image: docker.io/bitnami/ghost:3.35.5-debian-10-r1
          imagePullPolicy: IfNotPresent
          name: iteam-ghost
          #command: ["sleep", "3600"]
          ports:
            - containerPort: 2368
              name: http
              protocol: TCP
          resources:
            requests:
              cpu: 300m
              memory: 512Mi
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          volumeMounts:
            - mountPath: /bitnami
              name: iteam-ghost
      nodeSelector:
        name: k8s3
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext:
        fsGroup: 1001
        runAsUser: 1001
        runAsGroup: 1001
      terminationGracePeriodSeconds: 30
      volumes:
        - name: iteam-ghost
          persistentVolumeClaim:
            claimName: iteam-ghost
