mirror of
https://github.com/bitnami/charts.git
synced 2026-03-09 15:38:00 +08:00
Signed-off-by: cleverhu <shouping.hu@daocloud.io> Signed-off-by: cleverhu <shouping.hu@daocloud.io>
48 lines
2.1 KiB
YAML
48 lines
2.1 KiB
YAML
{{- if .Values.service.ports }}
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: {{ template "common.names.fullname" . }}
|
|
namespace: {{ .Release.Namespace | quote }}
|
|
labels: {{- include "common.labels.standard" . | nindent 4 }}
|
|
app.kubernetes.io/component: haproxy
|
|
{{- if .Values.commonLabels }}
|
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
|
{{- end }}
|
|
{{- if .Values.service.labels }}
|
|
{{- include "common.tplvalues.render" (dict "value" .Values.service.labels "context" $) | nindent 4 }}
|
|
{{- end }}
|
|
{{- if or .Values.service.annotations .Values.commonAnnotations }}
|
|
annotations:
|
|
{{- if .Values.service.annotations }}
|
|
{{- include "common.tplvalues.render" ( dict "value" .Values.service.annotations "context" $ ) | nindent 4 }}
|
|
{{- end }}
|
|
{{- if .Values.commonAnnotations }}
|
|
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
spec:
|
|
type: {{ .Values.service.type }}
|
|
{{- if .Values.clusterIP }}
|
|
clusterIP: {{ .Values.clusterIP }}
|
|
{{- end }}
|
|
{{- if (or (eq .Values.service.type "LoadBalancer") (eq .Values.service.type "NodePort")) }}
|
|
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy | quote }}
|
|
{{- end }}
|
|
{{- if eq .Values.service.type "LoadBalancer" }}
|
|
loadBalancerSourceRanges: {{ .Values.service.loadBalancerSourceRanges }}
|
|
{{- if .Values.service.loadBalancerIP }}
|
|
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if .Values.service.sessionAffinity }}
|
|
sessionAffinity: {{ .Values.service.sessionAffinity }}
|
|
{{- end }}
|
|
{{- if .Values.service.sessionAffinityConfig }}
|
|
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.service.sessionAffinityConfig "context" $) | nindent 4 }}
|
|
{{- end }}
|
|
ports: {{- include "common.tplvalues.render" ( dict "value" .Values.service.ports "context" $ ) | nindent 4 }}
|
|
selector: {{- include "common.labels.matchLabels" . | nindent 4 }}
|
|
app.kubernetes.io/component: haproxy
|
|
{{- end }}
|