service.yaml 820 B

1234567891011121314151617181920212223242526
  1. {{- if and .Values.exporter.enabled .Values.exporter.service }}
  2. {{- $svcValues := .Values.exporter.service }}
  3. {{- $componet := "kafka-exporter" }}
  4. apiVersion: v1
  5. kind: Service
  6. metadata:
  7. name: {{ include "kafka.exporter.fullname" . }}
  8. labels:
  9. {{- include "kafka.labels" . | nindent 4 }}
  10. {{- with $svcValues.labels }}
  11. {{- toYaml . | nindent 4 }}
  12. {{- end }}
  13. {{- with $svcValues.annotations }}
  14. annotations:
  15. {{- toYaml . | nindent 4 }}
  16. {{- end }}
  17. spec:
  18. ports:
  19. - name: {{ $svcValues.portName | default "http-metrics" }}
  20. port: {{ $svcValues.port | default 9308 }}
  21. targetPort: {{ .Values.exporter.containerPortName | default "http-metrics" }}
  22. protocol: TCP
  23. selector:
  24. {{- include "kafka.selectorLabels" . | nindent 4 }}
  25. component: {{ $componet | quote }}
  26. {{- end }}