apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
  name: datagrepper
  labels:
    app: Datagrepper
spec:
  replicas: 1
  selector:
    app: Datagrepper
    deploymentconfig: datagrepper
  strategy:
    type: Rolling
    activeDeadlineSeconds: 21600
    rollingParams:
      intervalSeconds: 1
      maxSurge: 25%
      maxUnavailable: 25%
      timeoutSeconds: 600
      updatePeriodSeconds: 1
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: Datagrepper
        deploymentconfig: datagrepper
    spec:
      containers:
      - name: datagrepper
        imagePullPolicy: Always
        ports:
        - containerPort: 8080
        #resources: {}
        #terminationMessagePath: /dev/termination-log
        #terminationMessagePolicy: File
        volumeMounts:
        - name: datagrepper-config-volume
          mountPath: "/etc/datagrepper"
          readOnly: true
        - name: wsgi-script-volume
          mountPath: "/opt/app-root/src/deploy"
          readOnly: true
        env:
        - name: DATAGREPPER_CONFIG
          value: "/etc/datagrepper/datagrepper.cfg"
        - name: APP_MODULE
          value: "deploy.wsgi"
        - name: APP_CONFIG
          value: "/etc/datagrepper/gunicorn.conf.py"
        - name: SCRIPT_NAME
          value: "/datagrepper"
        readinessProbe:
          timeoutSeconds: 10
          initialDelaySeconds: 5
          periodSeconds: 60
          httpGet:
            path: "/datagrepper/healthz/ready"
            port: 8080
        livenessProbe:
          timeoutSeconds: 10
          initialDelaySeconds: 3
          periodSeconds: 60
          httpGet:
            path: "/datagrepper/healthz/live"
            port: 8080
      volumes:
      - name: datagrepper-config-volume
        configMap:
          name: datagrepper-config
      - name: wsgi-script-volume
        configMap:
          name: wsgi-script
  triggers:
  - imageChangeParams:
      automatic: true
      containerNames:
      - datagrepper
      from:
        kind: ImageStreamTag
        name: datagrepper:latest
    type: ImageChange
  - type: ConfigChange
