github.com/verrazzano/verrazzano@v1.7.0/platform-operator/thirdparty/charts/prometheus-community/prometheus-pushgateway/templates/service.yaml (about) 1 {{- $stsNoHeadlessSvcTypes := list "LoadBalancer" "NodePort" -}} 2 apiVersion: v1 3 kind: Service 4 metadata: 5 {{- with .Values.serviceAnnotations }} 6 annotations: 7 {{- toYaml . | nindent 4 }} 8 {{- end }} 9 labels: 10 {{- include "prometheus-pushgateway.defaultLabels" . | nindent 4 }} 11 {{- with .Values.serviceLabels }} 12 {{- toYaml . | nindent 4 }} 13 {{- end }} 14 name: {{ include "prometheus-pushgateway.fullname" . }} 15 namespace: {{ template "prometheus-pushgateway.namespace" . }} 16 spec: 17 {{- if .Values.service.clusterIP }} 18 clusterIP: {{ .Values.service.clusterIP }} 19 {{ else if and .Values.runAsStatefulSet (not (has .Values.service.type $stsNoHeadlessSvcTypes)) }} 20 clusterIP: None # Headless service 21 {{- end }} 22 type: {{ .Values.service.type }} 23 {{- with .Values.service.loadBalancerIP }} 24 loadBalancerIP: {{ . }} 25 {{- end }} 26 {{- if .Values.service.loadBalancerSourceRanges }} 27 loadBalancerSourceRanges: 28 {{- range $cidr := .Values.service.loadBalancerSourceRanges }} 29 - {{ $cidr }} 30 {{- end }} 31 {{- end }} 32 ports: 33 - port: {{ .Values.service.port }} 34 targetPort: {{ .Values.service.targetPort }} 35 {{- if and (eq .Values.service.type "NodePort") .Values.service.nodePort }} 36 nodePort: {{ .Values.service.nodePort }} 37 {{- end }} 38 protocol: TCP 39 name: http 40 selector: 41 {{- include "prometheus-pushgateway.selectorLabels" . | nindent 4 }}