apiVersion: apps/v1
kind: Deployment
metadata:
  name: openhim-console-deployment
  labels:
    package: core
spec:
  replicas: 2
  selector:
    matchLabels:
      component: openhim-console
  template:
    metadata:
      labels:
        component: openhim-console
    spec:
      initContainers:
        - name: console-check-opehim-core-status
          image: busybox:1.28
          command: ['sh', '-c', 'until telnet openhim-core-service 8082; do echo OpenHIM not running yet; sleep 10; done;']
      containers:
        - name: openhim-console
          image: jembi/openhim-console:1.14
          ports:
            - containerPort: 80
          volumeMounts:
            - name: core-openhim-console-volume
              mountPath: /usr/share/nginx/html/config/
      volumes:
        - name: core-openhim-console-volume
          configMap:
            name: core-openhim-console-configmap
