kind: Service
apiVersion: v1
metadata:
  name: {{ template "prometheus-snmp-exporter.fullname" . }}
  namespace: {{ .Release.Namespace }}
  {{- if .Values.service.annotations }}
  annotations:
{{ toYaml .Values.service.annotations | indent 4 }}
{{- end }}
  labels:
    app.kubernetes.io/name: {{ include "prometheus-snmp-exporter.name" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
    helm.sh/chart: {{ include "prometheus-snmp-exporter.chart" . }}
{{- if .Values.service.labels }}
{{ toYaml .Values.service.labels | indent 4 }}
{{- end }}
spec:
  type: {{ .Values.service.type }}
  ports:
    - name: http
      port: {{ .Values.service.port }}
      protocol: TCP
{{- if .Values.service.externalIPs }}
  externalIPs:
{{ toYaml .Values.service.externalIPs | indent 4 }}
{{- end }}
  selector:
    app.kubernetes.io/name: {{ include "prometheus-snmp-exporter.name" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
