36 lines
1.1 KiB
YAML
36 lines
1.1 KiB
YAML
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: {{ template "fluentd.fullname" . }}
|
|
labels:
|
|
app: {{ template "fluentd.name" . }}
|
|
chart: {{ template "fluentd.chart" . }}
|
|
release: {{ .Release.Name }}
|
|
heritage: {{ .Release.Service }}
|
|
annotations:
|
|
{{ toYaml .Values.service.annotations | indent 4 }}
|
|
spec:
|
|
type: {{ .Values.service.type }}
|
|
{{ if (and (eq .Values.service.type "LoadBalancer") (not (empty .Values.service.loadBalancerIP))) }}
|
|
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
|
|
{{ end }}
|
|
ports:
|
|
{{- range $port := .Values.service.ports }}
|
|
- name: {{ $port.name }}
|
|
port: {{ $port.containerPort }}
|
|
targetPort: {{ $port.containerPort }}
|
|
protocol: {{ $port.protocol }}
|
|
{{- end }}
|
|
{{ if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }}
|
|
nodePort: {{ .Values.service.nodePort }}
|
|
{{ end }}
|
|
{{- if .Values.metrics.enabled }}
|
|
- name: metrics
|
|
port: {{ .Values.metrics.service.port }}
|
|
targetPort: metrics
|
|
protocol: TCP
|
|
{{- end }}
|
|
selector:
|
|
app: {{ template "fluentd.name" . }}
|
|
release: {{ .Release.Name }}
|