github.com/verrazzano/verrazzano@v1.7.0/platform-operator/thirdparty/charts/thanos/templates/query-frontend/service.yaml (about)

     1  {{- if .Values.queryFrontend.enabled -}}
     2  apiVersion: v1
     3  kind: Service
     4  metadata:
     5    name: {{ include "common.names.fullname" . }}-query-frontend
     6    namespace: {{ .Release.Namespace | quote }}
     7    labels: {{- include "common.labels.standard" . | nindent 4 }}
     8      app.kubernetes.io/component: query-frontend
     9      {{- if .Values.commonLabels }}
    10      {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
    11      {{- end }}
    12      {{- if .Values.queryFrontend.service.labels }}
    13      {{- include "common.tplvalues.render" (dict "value" .Values.queryFrontend.service.labels "context" $) | nindent 4 }}
    14      {{- end }}
    15    annotations:
    16      {{- if .Values.commonAnnotations }}
    17      {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
    18      {{- end }}
    19      {{- if .Values.queryFrontend.service.annotations }}
    20      {{- include "common.tplvalues.render" (dict "value" .Values.queryFrontend.service.annotations "context" $) | nindent 4 }}
    21      {{- end }}
    22  spec:
    23    type: {{ .Values.queryFrontend.service.type }}
    24    {{- if and .Values.queryFrontend.service.clusterIP (eq .Values.queryFrontend.service.type "ClusterIP") }}
    25    clusterIP: {{ .Values.queryFrontend.service.clusterIP }}
    26    {{- end }}
    27    {{- if ne .Values.queryFrontend.service.type "ClusterIP" }}
    28    externalTrafficPolicy: {{ .Values.queryFrontend.service.externalTrafficPolicy }}
    29    {{- end }}
    30    {{- if and .Values.queryFrontend.service.loadBalancerIP (eq .Values.queryFrontend.service.type "LoadBalancer") }}
    31    loadBalancerIP: {{ .Values.queryFrontend.service.loadBalancerIP }}
    32    {{- end }}
    33    {{- if and (eq .Values.queryFrontend.service.type "LoadBalancer") .Values.queryFrontend.service.loadBalancerSourceRanges }}
    34    loadBalancerSourceRanges: {{- toYaml .Values.queryFrontend.service.loadBalancerSourceRanges | nindent 4 }}
    35    {{- end }}
    36    ports:
    37      - port: {{ if .Values.queryFrontend.service.http }}{{ coalesce .Values.queryFrontend.service.ports.http .Values.queryFrontend.service.http.port }}{{ else }}{{ .Values.queryFrontend.service.ports.http }}{{ end }}
    38        targetPort: http
    39        protocol: TCP
    40        name: http
    41        {{- if and (or (eq .Values.queryFrontend.service.type "NodePort") (eq .Values.queryFrontend.service.type "LoadBalancer")) .Values.queryFrontend.service.nodePorts.http }}
    42        nodePort: {{ .Values.queryFrontend.service.nodePorts.http }}
    43        {{- else if eq .Values.queryFrontend.service.type "ClusterIP" }}
    44        nodePort: null
    45        {{- end }}
    46      {{- if .Values.queryFrontend.service.extraPorts }}
    47      {{- include "common.tplvalues.render" (dict "value" .Values.queryFrontend.service.extraPorts "context" $) | nindent 4 }}
    48      {{- end }}
    49    selector:
    50      {{- if .Values.queryFrontend.service.labelSelectorsOverride }}
    51      {{- include "common.tplvalues.render" (dict "value" .Values.queryFrontend.service.labelSelectorsOverride "context" $) | nindent 4 }}
    52      {{- else }}
    53      {{- include "common.labels.matchLabels" . | nindent 4 }}
    54      app.kubernetes.io/component: query-frontend
    55      {{- end }}
    56  {{- end }}