Files
devops-infra-helm-charts-gcp/helm-templates/contour-v1.33.3/templates/envoy/service-loadbalancer.yaml
T
2026-08-26 03:39:42 +05:30

48 lines
2.2 KiB
YAML

{{- /*
Meesho Custom: GCP Internal Load Balancer for Envoy service
*/}}
{{- if .Values.envoy.enabled }}
{{- if .Values.envoy.service.tcpLB }}
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.envoy.podLabels .Values.commonLabels ) "context" . ) }}
apiVersion: v1
kind: Service
metadata:
name: {{ printf "%s-envoy" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}-tcp-lb
namespace: {{ include "common.names.namespace" . | quote }}
annotations:
networking.gke.io/load-balancer-type: "Internal"
{{- $versionLabel := dict "app.kubernetes.io/version" ( include "common.images.version" ( dict "imageRoot" .Values.envoy.image "chart" .Chart ) ) }}
{{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.envoy.service.labels .Values.commonLabels $versionLabel ) "context" . ) }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: envoy
spec:
{{- if .Values.envoy.service.sessionAffinity }}
sessionAffinity: {{ .Values.envoy.service.sessionAffinity }}
{{- end }}
{{- if .Values.envoy.service.sessionAffinityConfig }}
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.envoy.service.sessionAffinityConfig "context" $) | nindent 4 }}
{{- end }}
{{- if .Values.envoy.service.ipFamilyPolicy }}
ipFamilyPolicy: {{ .Values.envoy.service.ipFamilyPolicy }}
{{- end }}
ports:
- name: http
port: {{ .Values.envoy.service.ports.http }}
protocol: TCP
targetPort: {{ .Values.envoy.service.targetPorts.http }}
{{- if .Values.envoy.service.ports.grpc }}
- name: grpc
port: {{ .Values.envoy.service.ports.grpc }}
protocol: TCP
targetPort: {{ .Values.envoy.service.targetPorts.http }}
{{- end }}
{{- if .Values.envoy.service.extraPorts }}
{{- include "common.tplvalues.render" (dict "value" .Values.envoy.service.extraPorts "context" $) | nindent 4 }}
{{- end }}
selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: envoy
type: LoadBalancer
{{- end }}
{{- end }}