mirror of
https://github.com/k8s-at-home/charts.git
synced 2025-01-24 16:09:08 +00:00
49 lines
1.5 KiB
YAML
49 lines
1.5 KiB
YAML
|
apiVersion: v1
|
||
|
kind: Service
|
||
|
metadata:
|
||
|
name: {{ template "ser2sock.fullname" . }}
|
||
|
labels:
|
||
|
{{ include "ser2sock.labels" . | indent 4 }}
|
||
|
{{- if .Values.service.labels }}
|
||
|
{{ toYaml .Values.service.labels | indent 4 }}
|
||
|
{{- end }}
|
||
|
{{- with .Values.service.annotations }}
|
||
|
annotations:
|
||
|
{{ toYaml . | indent 4 }}
|
||
|
{{- end }}
|
||
|
spec:
|
||
|
{{- if (or (eq .Values.service.type "ClusterIP") (empty .Values.service.type)) }}
|
||
|
type: ClusterIP
|
||
|
{{- if .Values.service.clusterIP }}
|
||
|
clusterIP: {{ .Values.service.clusterIP }}
|
||
|
{{end}}
|
||
|
{{- else if eq .Values.service.type "LoadBalancer" }}
|
||
|
type: {{ .Values.service.type }}
|
||
|
{{- if .Values.service.loadBalancerIP }}
|
||
|
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
|
||
|
{{- end }}
|
||
|
{{- if .Values.service.loadBalancerSourceRanges }}
|
||
|
loadBalancerSourceRanges:
|
||
|
{{ toYaml .Values.service.loadBalancerSourceRanges | indent 4 }}
|
||
|
{{- end -}}
|
||
|
{{- else }}
|
||
|
type: {{ .Values.service.type }}
|
||
|
{{- end }}
|
||
|
{{- if .Values.service.externalIPs }}
|
||
|
externalIPs:
|
||
|
{{ toYaml .Values.service.externalIPs | indent 4 }}
|
||
|
{{- end }}
|
||
|
{{- if .Values.service.externalTrafficPolicy }}
|
||
|
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }}
|
||
|
{{- end }}
|
||
|
ports:
|
||
|
- name: http
|
||
|
port: {{ .Values.service.port }}
|
||
|
protocol: TCP
|
||
|
targetPort: http
|
||
|
{{ if (and (eq .Values.service.type "NodePort") (not (empty .Values.service.nodePort))) }}
|
||
|
nodePort: {{.Values.service.nodePort}}
|
||
|
{{ end }}
|
||
|
selector:
|
||
|
app.kubernetes.io/name: {{ include "ser2sock.name" . }}
|
||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|