apiVersion: apps/v1
# ===============LICENSE_START=======================================================
# Acumos Apache-2.0
# ===================================================================================
# Copyright (C) 2019 Nordix Foundation
# Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
# ===================================================================================
# This Acumos software file is distributed by Nordix Foundation and AT&T
# 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 deployment template for nginx as deployed with
# Acumos models in kubernetes environments, for logging of model events.
#
# Usage: intended to be customized and created for the specific deployment by
# deploy.sh
#

kind: Deployment
metadata:
  namespace: <NAMESPACE>
  name: nginx-proxy-mc
  labels:
    app: nginx-proxy-mc
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nginx-proxy-mc
  template:
    metadata:
      labels:
        app: nginx-proxy-mc
    spec:
      imagePullSecrets:
      - name: docker-registry
      containers:
      - name: nginx-proxy-mc
        image: nginx:1.15
        ports:
        - name: proxy-api
          containerPort: 80
        volumeMounts:
            - name: nginx-proxy-config-volume-mc
              mountPath: /etc/nginx/proxy.conf
              subPath: proxy.conf
            - name: nginx-proxy-config-volume-mc
              mountPath: /etc/nginx/cors.conf
              subPath: cors.conf
            - name: nginx-proxy-config-volume-mc
              mountPath: /etc/nginx/nginx.conf
              subPath: nginx.conf
            - name: nginx-proxy-volume-mc
              mountPath: /var/log/nginx/<NAMESPACE>
      volumes:
        - name: nginx-proxy-config-volume-mc
          configMap:
            name: nginx-proxy-conf-mc
        - name: nginx-proxy-volume-mc
          hostPath:
            path: /var/log/nginx/<NAMESPACE>
            type: DirectoryOrCreate
