---
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
  name: maubot
  labels:
    app: maubot
    service: maubot
spec:
  replicas: 1
  selector:
    app: maubot
    service: maubot
  template:
    metadata:
      labels:
        app: maubot
        service: maubot
    spec:
      containers:
        - name: maubot
          image: maubot:latest
          ports:
            - containerPort: 8080
          volumeMounts:
            - name: config
              mountPath: /config
              readOnly: true
            - name: meetbot-logs
              mountPath: /meetbot_logs
            - name: ipa-config-volume
              mountPath: /etc/ipa
              readOnly: true
            - name: keytab-volume
              mountPath: /etc/keytabs
              readOnly: true
            - name: fedora-messaging-config-volume
              mountPath: /etc/fedora-messaging/
              readOnly: true
            - name: fedora-messaging-ca-volume
              mountPath: /etc/pki/rabbitmq/ca
              readOnly: true
            - name: fedora-messaging-key-volume
              mountPath: /etc/pki/rabbitmq/key
              readOnly: true
            - name: fedora-messaging-crt-volume
              mountPath: /etc/pki/rabbitmq/crt
              readOnly: true
          readinessProbe:
            timeoutSeconds: 1
            initialDelaySeconds: 5
            httpGet:
              path: /
              port: 8080
          livenessProbe:
            timeoutSeconds: 1
            initialDelaySeconds: 20
            httpGet:
              path: /
              port: 8080
      securityContext:
        supplementalGroups: [2]
      volumes:
        - name: config
          configMap:
            name: config
        - name: meetbot-logs
          persistentVolumeClaim:
            claimName: meetbot-logs
        - name: ipa-config-volume
          configMap:
            name: ipa-client-config
        - name: keytab-volume
          secret:
            secretName: maubot-keytab
        - name: fedora-messaging-config-volume
          configMap:
            name: fedora-messaging-configmap
        - name: fedora-messaging-ca-volume
          secret:
              secretName: maubot-fedora-messaging-ca
        - name: fedora-messaging-key-volume
          secret:
              secretName: maubot-fedora-messaging-key
        - name: fedora-messaging-crt-volume
          secret:
              secretName: maubot-fedora-messaging-crt
  triggers:
    - type: ConfigChange
    - type: ImageChange
      imageChangeParams:
        automatic: true
        containerNames:
          - maubot
        from:
          kind: ImageStreamTag
          name: maubot:latest
