apiVersion: v1
kind: ConfigMap
metadata:
  name: rhpam-process-migration
data:
  project-overrides.yml: |-
    kieservers:
      - host: http://other-kieserver:8080/services/rest/server
        username: adminUser
        password: example
      - host: http://rhpam-ldap-kieserver:8080/services/rest/server
        username: adminUser
        password: secret
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
  annotations:
    description: Route for Process Migration https service.
  labels:
    service: rhpam-process-migration
  name: rhpam-process-migration
spec:
  port:
    targetPort: http
  tls:
    insecureEdgeTerminationPolicy: Redirect
  to:
    kind: Service
    name: rhpam-process-migration

---
apiVersion: v1
kind: Service
metadata:
  annotations:
    description: Process Migration web server's port.
  labels:
    service: rhpam-process-migration
  name: rhpam-process-migration
spec:
  ports:
  - name: http
    port: 8080
    protocol: TCP
    targetPort: 8080
  selector:
    deploymentConfig: rhpam-process-migration
---
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
  labels:
    service: rhpam-process-migration
  name: rhpam-process-migration
spec:
  replicas: 1
  selector:
    deploymentConfig: rhpam-process-migration
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        deploymentConfig: rhpam-process-migration
        service: rhpam-process-migration
      name: rhpam-process-migration
    spec:
      containers:
      - env:
          - name: JBOSS_KIE_ADMIN_USER
            value: test
          - name: JBOSS_KIE_ADMIN_PWD
            value: secret
          - name: JBOSS_KIE_EXTRA_CONFIG
            value: "/opt/rhpam-process-migration/config/project-overrides.yml"
        image: ""
        imagePullPolicy: Always
        livenessProbe:
          failureThreshold: 3
          httpGet:
            path: /rest/health
            port: 8080
            scheme: HTTP
          initialDelaySeconds: 180
          periodSeconds: 15
          successThreshold: 1
          timeoutSeconds: 2
        name: rhpam-process-migration
        ports:
        - containerPort: 8080
          name: http
          protocol: TCP
        readinessProbe:
          failureThreshold: 36
          httpGet:
            path: /rest/health
            port: 8080
            scheme: HTTP
          initialDelaySeconds: 30
          periodSeconds: 5
          successThreshold: 1
          timeoutSeconds: 2
        resources:
          limits:
            memory: 512Mi
        volumeMounts:
          - mountPath: /opt/rhpam-process-migration/config/project-overrides.yml
            subPath: project-overrides.yml
            name: config
      volumes:
        - name: config
          configMap:
            name: rhpam-process-migration
  triggers:
  - imageChangeParams:
      automatic: true
      containerNames:
      - rhpam-process-migration
      from:
        kind: ImageStreamTag
        name: rhpam-process-migration-rhel8:7.6.0
        namespace: openshift
    type: ImageChange
  - type: ConfigChange
