{{- if .Values.envoy.enabled }} {{- if .Values.envoy.service.tcpLB }} 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" labels: {{- include "common.labels.standard" . | nindent 4 }} app.kubernetes.io/component: envoy {{- if .Values.envoy.service.labels }} {{- include "common.tplvalues.render" (dict "value" .Values.envoy.service.labels "context" $) | nindent 4 }} {{- end }} {{- if .Values.commonLabels }} {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} {{- end }} 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" . | nindent 4 }} app.kubernetes.io/component: envoy type: LoadBalancer {{- end }} {{- end }}