blob: 6d0d69f6d20b938fad55affb2cef64b93cfa7ab0 [file] [log] [blame] [edit]
{{/*
TODO: Remove outer "if/elseif"
*/}}
{{- if .Values.serviceHeadless }}
{{- if .Values.serviceHeadless.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "vector.fullname" . }}-headless
labels:
{{- include "vector.labels" . | nindent 4 }}
annotations:
{{- with .Values.service.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
clusterIP: None
{{- if .Values.service.ipFamilyPolicy }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
{{- if .Values.service.internalTrafficPolicy }}
internalTrafficPolicy: {{ .Values.service.internalTrafficPolicy }}
{{- end }}
{{- if .Values.service.ipFamilies }}
{{- with .Values.service.ipFamilies }}
ipFamilies:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
ports:
{{- if or .Values.service.ports .Values.existingConfigMaps }}
{{- toYaml .Values.service.ports | nindent 4 }}
{{- else if .Values.customConfig }}
{{- include "vector.ports" . | indent 4 }}
{{- else }}
- name: datadog-agent
port: 8282
protocol: TCP
- name: fluent
port: 24224
protocol: TCP
- name: logstash
port: 5044
protocol: TCP
- name: splunk-hec
port: 8080
protocol: TCP
- name: statsd
port: 8125
protocol: TCP
- name: syslog
port: 9000
protocol: TCP
- name: vector
port: 6000
protocol: TCP
- name: prom-exporter
port: 9090
protocol: TCP
{{- end }}
selector:
{{- include "vector.selectorLabels" . | nindent 4 }}
type: ClusterIP
{{- with or .Values.service.topologyKeys }}
topologyKeys:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{/*
Allow for clean upgrade from 0.16.3 -> 0.17.0
*/}}
{{- else if .Values.service.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "vector.fullname" . }}-headless
labels:
{{- include "vector.labels" . | nindent 4 }}
annotations:
{{- with .Values.service.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
clusterIP: None
{{- if .Values.service.ipFamilyPolicy }}
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
{{- end }}
{{- if .Values.service.internalTrafficPolicy }}
internalTrafficPolicy: {{ .Values.service.internalTrafficPolicy }}
{{- end }}
{{- if .Values.service.ipFamilies }}
{{- with .Values.service.ipFamilies }}
ipFamilies:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
ports:
{{- if or .Values.service.ports .Values.existingConfigMaps }}
{{- toYaml .Values.service.ports | nindent 4 }}
{{- else if .Values.customConfig }}
{{- include "vector.ports" . | indent 4 }}
{{- else }}
- name: datadog-agent
port: 8282
protocol: TCP
- name: fluent
port: 24224
protocol: TCP
- name: logstash
port: 5044
protocol: TCP
- name: splunk-hec
port: 8080
protocol: TCP
- name: statsd
port: 8125
protocol: TCP
- name: syslog
port: 9000
protocol: TCP
- name: vector
port: 6000
protocol: TCP
- name: prom-exporter
port: 9090
protocol: TCP
{{- end }}
selector:
{{- include "vector.selectorLabels" . | nindent 4 }}
type: ClusterIP
{{- with .Values.service.topologyKeys }}
topologyKeys:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}