service.yaml 716 B

123456789101112131415161718192021
  1. {{- range $name, $component := .Values.components }}
  2. ---
  3. apiVersion: v1
  4. kind: Service
  5. metadata:
  6. name: {{ include "chart.componentFullname" (dict "root" $ "name" $name) }}
  7. labels:
  8. {{- include "chart.componentLabels" (dict "root" $ "name" $name) | nindent 4 }}
  9. spec:
  10. type: {{ $component.service.type }}
  11. ports:
  12. - port: {{ $component.service.port }}
  13. targetPort: {{ $component.service.portName | default "http" }}
  14. protocol: TCP
  15. name: {{ $component.service.portName | default "http" }}
  16. {{- with $component.service.nodePort }}
  17. nodePort: {{ . }}
  18. {{- end }}
  19. selector:
  20. {{- include "chart.componentSelectorLabels" (dict "root" $ "name" $name) | nindent 4 }}
  21. {{- end }}