service.yaml 1004 Bytes
Newer Older
konfiot's avatar
konfiot committed
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
apiVersion: v1
kind: Service
metadata:
  name: {{ template "sonarqube.fullname" . }}
  labels:
    app: {{ template "sonarqube.name" . }}
    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
  annotations:
    {{- range $key, $value := .Values.service.annotations }}
      {{ $key }}: {{ $value | quote }}
    {{- end }}
spec:
  type: {{ .Values.service.type }}
  ports:
    - port: {{ .Values.service.externalPort }}
{{- if ne .Values.service.type "ClusterIP" }}
      targetPort: {{ .Values.service.internalPort }}
{{- end }}
      protocol: TCP
      name: {{ .Values.service.name }}
  selector:
    app: {{ template "sonarqube.name" . }}
    release: {{ .Release.Name }}
  {{- if eq .Values.service.type "LoadBalancer"}}
  loadBalancerSourceRanges: {{.Values.service.loadBalancerSourceRanges}}
28
  {{- if .Values.service.loadBalancerIP}}
konfiot's avatar
konfiot committed
29 30 31
  loadBalancerIP: {{.Values.service.loadBalancerIP}}
  {{- end }}
  {{- end }}