---
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
  name: mdapi
  labels:
    app: mdapi
    service: mdapi
spec:
  replicas: 1
  selector:
    app: mdapi
    service: mdapi
  template:
    metadata:
      labels:
        app: mdapi
        service: mdapi
    spec:
      containers:
      - name: mdapi
        image: registry/mdapi:latest
        ports:
        - containerPort: 8080
        volumeMounts:
          - name: myconfigpy-volume
            mountPath: /etc/mdapi/confdata/
            readOnly: true
          - name: config-volume
            mountPath: /etc/mdapi/
            readOnly: true
          - name: data-volume
            mountPath: /var/tmp/
        readinessProbe:
          timeoutSeconds: 5
          initialDelaySeconds: 60
          periodSeconds: 60
          httpGet:
            path: /
            port: 8080
        livenessProbe:
          timeoutSeconds: 15
          initialDelaySeconds: 60
          periodSeconds: 60
          httpGet:
            path: /
            port: 8080
        resources:
      volumes:
       - name: config-volume
         configMap:
           name: mdapi-configmap
       - name: myconfigpy-volume
         configMap:
           name: mdapi-myconfigpy-configmap
       - name: data-volume
         persistentVolumeClaim:
           claimName: mdapi-storage
  triggers:
  - type: ImageChange
    imageChangeParams:
      automatic: true
      containerNames:
      - "mdapi"
      from:
        kind: ImageStreamTag
        name: mdapi:latest
