apiVersion: apps/v1
kind: Deployment
metadata:
  name: console
  namespace: console-system
spec:
  replicas: 1
  selector:
    matchLabels:
      app: console
      hypercloud: ui
  template:
    metadata:
      labels:
        app: console
        hypercloud: ui
      name: hypercloud-ui
    spec:
      containers:
        - command:
            - /opt/bridge/bin/console
            - gateway
            - --public-dir=/opt/bridge/static
            - --dynamic-file=/opt/bridge/configs/dynamic-config.yaml
            - --listen=https://0.0.0.0:443
            - --base-address=https://0.0.0.0:443
            - --redirect-port=80
            - --tls-cert-file=/var/https-cert/cert
            - --tls-key-file=/var/https-cert/key
            - --keycloak-realm=@@REALM@@
            - --keycloak-auth-url=https://@@KEYCLOAK@@/auth
            - --keycloak-client-id=@@CLIENTID@@
            - --mc-mode=@@MC_MODE@@
            - --grafana-endpoint=http://grafana.monitoring.svc:3000/api/grafana/
            - --kiali-endpoint=https://@@KIALI@@/api/kiali
            - --kibana-endpoint=http://@@KIBANA@@/api/kibana/
            - --kubeflow-endpoint=http://@@KUBEFLOW@@/api/kubeflow/
            - --managed-gitlab-url=@@GITLAB@@
          image: tmaxcloudck/hypercloud-console:@@CONSOLE_VER@@
          imagePullPolicy: Always
          name: console
          ports:
            - containerPort: 443
              protocol: TCP
            - containerPort: 80
              protocol: TCP
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          volumeMounts:
            - mountPath: /var/https-cert
              name: https-cert
              readOnly: true
            - mountPath: /etc/localtime
              name: localtime
              readOnly: true
            - mountPath: /etc/timezone
              name: timezone
              readOnly: true
            - mountPath: /opt/bridge/configs
              name: dynamic-config
        - command:
            - /manager
          args:
            - --pwd=/var/tmp/configs/
          image: tmaxcloudck/console-operator:@@OPERATOR_VER@@
          name: manager
          volumeMounts:
            - mountPath: /var/tmp/configs
              name: dynamic-config
      serviceAccount: console-system-admin
      volumes:
        - name: https-cert
          secret:
            defaultMode: 288
            secretName: console-https-secret
        - hostPath:
            path: /etc/localtime
            type: ""
          name: localtime
        - hostPath:
            path: /etc/timezone
            type: ""
          name: timezone
        - emptyDir:
            medium: "Memory"
          name: dynamic-config
