#-------------------------------------------------------------------------------
# @license
# Copyright SOAJS All Rights Reserved.
#
# Use of this source code is governed by an Apache license that can be
# found in the LICENSE file at the root of this repository
#-------------------------------------------------------------------------------

apiVersion: v1
kind: Service
metadata:
  name: "{{ .Values.settings.label }}-v{{ .Values.settings.version }}-service"
  namespace: "{{ .Values.global.namespace }}"
  labels:
    service.image.ts: "{{ .Values.global.TS }}"
    soajs.catalog.id: "{{ .Values.settings.catalogId }}"
    soajs.catalog.v: "1"
    soajs.content: "true"
    soajs.env.code: "dashboard"
    soajs.service.group: "{{ .Values.settings.item.group }}"
    soajs.service.label: "{{ .Values.settings.label }}-v{{ .Values.settings.version }}"
    soajs.service.mode: "daemonset"
    soajs.service.name: "{{ .Values.settings.item.name }}"
    soajs.service.subtype: "soajs"
    soajs.service.type: "statis"
    soajs.service.version: "{{ .Values.settings.version }}"
spec:
  type: LoadBalancer
  ports:
  - port: 80
    targetPort: 80
    name: http
  - port: 443
    targetPort: 443
    name: https
  selector:
    soajs.service.label: "{{ .Values.settings.label }}-v{{ .Values.settings.version }}"