jmx-metrics-svc.yaml 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. {{- if .Values.metrics.jmx.enabled }}
  2. apiVersion: v1
  3. kind: Service
  4. metadata:
  5. name: {{ printf "%s-jmx-metrics" (include "common.names.fullname" .) }}
  6. namespace: {{ .Release.Namespace | quote }}
  7. labels: {{- include "common.labels.standard" . | nindent 4 }}
  8. app.kubernetes.io/component: metrics
  9. {{- if .Values.commonLabels }}
  10. {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
  11. {{- end }}
  12. {{- if or .Values.metrics.jmx.service.annotations .Values.commonAnnotations }}
  13. annotations:
  14. {{- if .Values.metrics.jmx.service.annotations }}
  15. {{ include "common.tplvalues.render" ( dict "value" .Values.metrics.jmx.service.annotations "context" $) | nindent 4 }}
  16. {{- end }}
  17. {{- if .Values.commonAnnotations }}
  18. {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
  19. {{- end }}
  20. {{- end }}
  21. spec:
  22. type: ClusterIP
  23. sessionAffinity: {{ .Values.metrics.jmx.service.sessionAffinity }}
  24. {{- if .Values.metrics.jmx.service.clusterIP }}
  25. clusterIP: {{ .Values.metrics.jmx.service.clusterIP }}
  26. {{- end }}
  27. ports:
  28. - name: http-metrics
  29. port: {{ .Values.metrics.jmx.service.ports.metrics }}
  30. protocol: TCP
  31. targetPort: metrics
  32. selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
  33. app.kubernetes.io/component: kafka
  34. {{- end }}