apiVersion: batch/v1
kind: Job
metadata:
  name: gg-ui-preparation
spec:
  template:
    spec:
      restartPolicy: Never
      volumes:
        - name: tls-certificate
          secret:
            items:
              - key: tls.crt
                path: tls.crt
              - key: tls.key
                path: tls.key
            secretName: tls-certificate
      containers:
        - name: gg-ui-prepareation
          image: gluufederation/gluu-gateway-ui:4.2.0_01
          imagePullPolicy: Always
          env:
            - name: DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: gg-ui-postgres-pass
                  key: DB_PASSWORD
          envFrom:
          - configMapRef:
              name: gg-ui-cm
          volumeMounts:
            - mountPath: /etc/certs
              name: tls-certificate
          command:
            - /bin/sh
            - -c
            - |
                ./entrypoint.sh -c prepare -a postgres -u postgresql://konga:konga@postgres.postgres.svc.cluster.local:5432/konga