apiVersion: apps/v1
# ===============LICENSE_START=======================================================
# Acumos Apache-2.0
# ===================================================================================
# Copyright (C) 2017-2018 AT&T Intellectual Property & Tech Mahindra. All rights reserved.
# ===================================================================================
# This Acumos software file is distributed by AT&T and Tech Mahindra
# under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# This file is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ===============LICENSE_END=========================================================

# What this is: kubernetes template for Acumos portal-fe deployment
# How to use:
# - Replace fields in <> with actual values (k8s does not support env variables)

kind: Deployment
metadata:
  namespace: acumos
  name: portal-fe
  labels:
    app: portal-fe
spec:
  replicas: 1
  selector:
    matchLabels:
      app: portal-fe
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: portal-fe
    spec:
      imagePullSecrets:
      - name: acumos-registry
      containers:
      - name: portal-fe
        image: <PORTAL_FE_IMAGE>
        env:
        - name: SPRING_APPLICATION_JSON
          value: '{
                    "server": {
                      "port": 8085
                    },
                    "zuul": {
                      "routes": {
                        "api": {
                          "url": "http://portal-be-service:8083"
                        },
                        "dsce": {
                          "url": "http://dsce-service:8088"
                        },
                        "site": {
                          "url": "http://cms-service:9080"
                        },
                        "cmnt": {
                          "url": "http://delete-me"
                        },
                        "azure": {
                          "url": "http://azure-client-service:9081"
                        },
                        "openstack" : {
                          "path": "/openstack/**",
                          "url": "http://openstack-client-service:8007",
                          "stripPrefix": "false",
                          "sensitiveHeaders": ""
                        },
                        "package": {
                          "path": "/package/**",
                          "url": "http://kubernetes-client-service:8082",
                          "stripPrefix": "true",
                          "sensitiveHeaders": ""
                        }
                      },
                      "host": {
                        "connect-timeout-millis": 300000,
                        "socket-timeout-millis": 300000
                      }
                    },
                    "spring": {
                      "http": {
                        "multipart": {
                          "max-file-size": -1,
                          "max-request-size": -1
                        }
                      }
                    }
                  }'
        ports:
        - containerPort: 8085
        volumeMounts:
        - mountPath: /maven/logs
          name: acumos-logs
      restartPolicy: Always
      volumes:
      - name: acumos-logs
        hostPath:
          path: /var/acumos/logs
      hostAliases:
      - ip: "<ACUMOS_HOST>"
        hostnames:
        - "<ACUMOS_DOMAIN>"
