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

     1  {{- if and .Values.storegateway.enabled (not .Values.storegateway.sharded.enabled) }}
     2  apiVersion: v1
     3  kind: Service
     4  metadata:
     5    name: {{ include "common.names.fullname" . }}-storegateway
     6    namespace: {{ .Release.Namespace | quote }}
     7    labels: {{- include "common.labels.standard" . | nindent 4 }}
     8      app.kubernetes.io/component: storegateway
     9      {{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }}
    10      prometheus-operator/monitor: 'true'
    11      {{- end }}
    12      {{- if .Values.commonLabels }}
    13      {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "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.storegateway.service.annotations }}
    20      {{- include "common.tplvalues.render" (dict "value" .Values.storegateway.service.annotations "context" $) | nindent 4 }}
    21      {{- end }}
    22  spec:
    23    type: {{ .Values.storegateway.service.type }}
    24    {{- if and .Values.storegateway.service.clusterIP (eq .Values.storegateway.service.type "ClusterIP") }}
    25    clusterIP: {{ .Values.storegateway.service.clusterIP }}
    26    {{- end }}
    27    {{- if ne .Values.storegateway.service.type "ClusterIP" }}
    28    externalTrafficPolicy: {{ .Values.storegateway.service.externalTrafficPolicy }}
    29    {{- end }}
    30    {{- if and .Values.storegateway.service.loadBalancerIP (eq .Values.storegateway.service.type "LoadBalancer") }}
    31    loadBalancerIP: {{ .Values.storegateway.service.loadBalancerIP }}
    32    {{- end }}
    33    {{- if and (eq .Values.storegateway.service.type "LoadBalancer") .Values.storegateway.service.loadBalancerSourceRanges }}
    34    loadBalancerSourceRanges: {{- toYaml .Values.storegateway.service.loadBalancerSourceRanges | nindent 4 }}
    35    {{- end }}
    36    ports:
    37      - port: {{ if .Values.storegateway.service.http }}{{ coalesce .Values.storegateway.service.ports.http .Values.storegateway.service.http.port }}{{ else }}{{ .Values.storegateway.service.ports.http }}{{ end }}
    38        targetPort: http
    39        protocol: TCP
    40        name: http
    41        {{- if and (or (eq .Values.storegateway.service.type "NodePort") (eq .Values.storegateway.service.type "LoadBalancer")) .Values.storegateway.service.nodePorts.http }}
    42        nodePort: {{ .Values.storegateway.service.nodePorts.http }}
    43        {{- else if eq .Values.storegateway.service.type "ClusterIP" }}
    44        nodePort: null
    45        {{- end }}
    46      - port: {{ if .Values.storegateway.service.grpc }}{{ coalesce .Values.storegateway.service.ports.grpc .Values.storegateway.service.grpc.port }}{{ else }}{{ .Values.storegateway.service.ports.grpc }}{{ end }}
    47        targetPort: grpc
    48        protocol: TCP
    49        name: grpc
    50        {{- if and (or (eq .Values.storegateway.service.type "NodePort") (eq .Values.storegateway.service.type "LoadBalancer")) .Values.storegateway.service.nodePorts.grpc }}
    51        nodePort: {{ .Values.storegateway.service.nodePorts.grpc }}
    52        {{- else if eq .Values.storegateway.service.type "ClusterIP" }}
    53        nodePort: null
    54        {{- end }}
    55      {{- if .Values.storegateway.service.extraPorts }}
    56      {{- include "common.tplvalues.render" (dict "value" .Values.storegateway.service.extraPorts "context" $) | nindent 4 }}
    57      {{- end }}
    58    selector:
    59      {{- if .Values.storegateway.service.labelSelectorsOverride }}
    60      {{- include "common.tplvalues.render" (dict "value" .Values.storegateway.service.labelSelectorsOverride "context" $) | nindent 4 }}
    61      {{- else }}
    62      {{- include "common.labels.matchLabels" . | nindent 4 }}
    63      app.kubernetes.io/component: storegateway
    64      {{- end }}
    65  {{- end }}