service.yaml 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. {{- if or (eq .Values.mode "deployment") (eq .Values.mode "statefulset") (.Values.ingress.enabled) -}}
  2. apiVersion: v1
  3. kind: Service
  4. metadata:
  5. name: {{ include "opentelemetry-collector.fullname" . }}
  6. labels:
  7. {{- include "opentelemetry-collector.labels" . | nindent 4 }}
  8. {{- include "opentelemetry-collector.component" . | nindent 4 }}
  9. {{- if .Values.service.annotations }}
  10. annotations:
  11. {{- range $key, $value := .Values.service.annotations }}
  12. {{- printf "%s: %s" $key (tpl $value $ | quote) | nindent 4 }}
  13. {{- end }}
  14. {{- end }}
  15. spec:
  16. type: {{ .Values.service.type }}
  17. {{- if .Values.service.clusterIP }}
  18. clusterIP: {{ .Values.service.clusterIP }}
  19. {{- end }}
  20. {{- if and .Values.service.loadBalancerIP (eq .Values.service.type "LoadBalancer") }}
  21. loadBalancerIP: {{ .Values.service.loadBalancerIP }}
  22. {{- end }}
  23. {{- if and .Values.service.loadBalancerSourceRanges (eq .Values.service.type "LoadBalancer") }}
  24. loadBalancerSourceRanges:
  25. {{- range .Values.service.loadBalancerSourceRanges }}
  26. - {{ . }}
  27. {{- end }}
  28. {{- end }}
  29. ports: {{ include "opentelemetry-collector.deploymentPortsConfig" . | nindent 4 }}
  30. selector:
  31. {{- include "opentelemetry-collector.selectorLabels" . | nindent 4 }}
  32. {{- include "opentelemetry-collector.component" . | nindent 4 }}
  33. {{- end }}