service.yaml 1.02 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
{{- if .Values.service.enabled -}}
apiVersion: v1
kind: Service
metadata:
{{- if .Values.service.name }}
  name: {{ .Values.service.name }}
{{- else }}
  name: {{ template "nexus.name" . }}-service
{{- end }}
  labels:
{{ include "nexus.labels" . | indent 4 }}
{{- if .Values.service.labels }}
{{ toYaml .Values.service.labels | indent 4 }}
{{- end }}
{{- if .Values.service.annotations }}
  annotations:
{{ toYaml .Values.service.annotations | indent 4 }}
{{- end }}
spec:
  ports:
  {{- if .Values.service.portName }}
  - name: {{ .Values.service.portName }}
    port: {{ .Values.service.port }}
    targetPort: {{ .Values.service.targetPort }}
  {{- end }}
  {{- with .Values.service.ports  }}
{{ toYaml . | indent 2 }}
  {{- end }}
  selector:
    app: {{ template "nexus.name" . }}
    release: {{ .Release.Name }}
  type: {{ .Values.service.type }}
  {{ if .Values.service.loadBalancerSourceRanges }}
  loadBalancerSourceRanges:
    {{- range .Values.service.loadBalancerSourceRanges }}
    - {{ . }}
    {{- end }}
  {{ end }}
{{- end}}