apiVersion: v1
kind: Service
metadata:
  name: {{ printf "%s-%s" .Release.Name "web"  }}
  namespace: {{ include "common.names.namespace" . | quote }}
  labels: {{- include "common.labels.standard" . | nindent 4 }}
    app.kubernetes.io/component: {{ printf "%s-%s" .Release.Name "web"  }}
    {{- if .Values.commonLabels }}
    {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
    {{- end }}
  {{- if or .Values.web.service.annotations .Values.commonAnnotations }}
  annotations:
    {{- if .Values.web.service.annotations }}
    {{- include "common.tplvalues.render" ( dict "value" .Values.web.service.annotations "context" $) | nindent 4 }}
    {{- end }}
    {{- if .Values.commonAnnotations }}
    {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
    {{- end }}
  {{- end }}
spec:
  type: "ClusterIP"
  ports:
    - name: http
      port: {{ .Values.web.port }}
      protocol: TCP
    {{- if .Values.web.service.extraPorts }}
    {{- include "common.tplvalues.render" (dict "value" .Values.web.service.extraPorts "context" $) | nindent 4 }}
    {{- end }}
  selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
    app.kubernetes.io/component: {{ printf "%s-%s" .Release.Name "web"  }}
