apiVersion: apps/v1 
kind: Deployment 
metadata:
  namespace: {{ .Release.Namespace }}
  labels:
    app: {{ include "openslice.fullname" . }}
    org.etsi.osl.service: tmfweb
    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
    {{- include "openslice.labels" . | nindent 4 }}
  name: {{ include "openslice.fullname" . }}-tmfweb
spec:
  {{- if not .Values.autoscaling.enabled }}
  replicas: {{ .Values.replicaCount }}
  {{- end }}
  selector:
    matchLabels:
      app: {{ include "openslice.fullname" . }}
      org.etsi.osl.service: tmfweb
      {{- include "openslice.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app: {{ include "openslice.fullname" . }}
        org.etsi.osl.service: tmfweb
        {{- include "openslice.selectorLabels" . | nindent 8 }}
    spec:
      hostNetwork: {{ .Values.hostNetwork }}
      containers:
        - image: "{{ .Values.image.tmfweb.repository }}:{{ .Values.image.tmfweb.tag | default .Chart.AppVersion }}"
          imagePullPolicy: {{ .Values.image.tmfweb.pullPolicy | default "Always" }}
          name: {{ include "openslice.fullname" . }}-tmfweb
          resources:
            {{- toYaml .Values.resources | nindent 12 }}
          ports:
            - containerPort: 80
          volumeMounts:
          - name: "tmfweb-configuration"
            readOnly: true
            mountPath: "/usr/share/nginx/html/services/assets/config"
      volumes:
        - name: "tmfweb-configuration"
          configMap:
            name: {{ include "openslice.fullname" . }}-tmfweb-config
      restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
  namespace: {{ .Release.Namespace }}
  labels:
    app: {{ include "openslice.fullname" . }}
    org.etsi.osl.service: tmfweb
    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
    {{- include "openslice.labels" . | nindent 4 }}
  name: {{ include "openslice.fullname" . }}-tmfweb
spec:
  ports:
    - name: "tmwebport"
      port: 80
  selector:
    app: {{ include "openslice.fullname" . }}
    org.etsi.osl.service: tmfweb
    {{- include "openslice.selectorLabels" . | nindent 4 }}
