apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: drupal
    appMajor: "8"
    instance: loyalistresearchnet.lib.unb.ca
    tier: frontend
    uri: loyalistresearchnet.lib.unb.ca
    vcsOwner: unb-libraries
    vcsRepository: loyalistresearchnet.lib.unb.ca
    vcsRef: prod
  name: loyalistresearchnet-lib-unb-ca
  namespace: prod
spec:
  selector:
    matchLabels:
      uri: loyalistresearchnet.lib.unb.ca
  replicas: 1
  revisionHistoryLimit: 2
  minReadySeconds: 30
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
  template:
    metadata:
      labels:
        app: drupal
        appMajor: "8"
        instance: loyalistresearchnet.lib.unb.ca
        tier: frontend
        uri: loyalistresearchnet.lib.unb.ca
        vcsOwner: unb-libraries
        vcsRepository: loyalistresearchnet.lib.unb.ca
        vcsRef: prod
    spec:
      nodeSelector:
        deployenv: prod
      containers:
        -
          name: loyalistresearchnet-lib-unb-ca
          readinessProbe:
            httpGet:
              path: /health
              port: 80
            initialDelaySeconds: 30
            timeoutSeconds: 3
            periodSeconds: 15
          livenessProbe:
            httpGet:
              path: /health
              port: 80
            initialDelaySeconds: 100
            timeoutSeconds: 3
            periodSeconds: 15
          env:
            -
              name: DEPLOY_ENV
              value: prod
            -
              name: MYSQL_HOSTNAME
              value: drupal-mysql-lib-unb-ca
            -
              name: MYSQL_PORT
              value: "3306"
            -
              name: MYSQL_ROOT_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: mysql
                  key: root-password
            -
              name: NR_INSTALL_KEY
              valueFrom:
                secretKeyRef:
                  name: newrelic
                  key: install-key
          image: "||DEPLOYMENTIMAGE||"
          imagePullPolicy: Always
          ports:
            -
              containerPort: 80
          volumeMounts:
            -
              mountPath: /app/html/sites/default
              name: drupal-persistent-storage
      priorityClassName: low-priority-services
      imagePullSecrets:
        -
          name: github-container-registry-auth
      restartPolicy: Always
      volumes:
        -
          name: drupal-persistent-storage
          persistentVolumeClaim:
            claimName: loyalistresearchnet-lib-unb-ca
