infra4talos/apps-helm/wg-access-server/templates/service.yaml

56 lines
1.6 KiB
YAML
Raw Normal View History

{{- $fullName := include "wg-access-server.fullname" . -}}
apiVersion: v1
kind: Service
metadata:
name: {{ $fullName }}-web
labels:
{{- include "wg-access-server.labels" . | nindent 4 }}
{{- if .Values.web.service.annotations }}
annotations:
{{ toYaml .Values.web.service.annotations | indent 4 }}
{{- end }}
spec:
{{- if .Values.web.service.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.web.service.externalTrafficPolicy }}
{{- end }}
type: {{ .Values.web.service.type }}
{{- if .Values.web.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.web.service.loadBalancerIP }}
{{- end }}
ports:
- port: 80
targetPort: 8000
protocol: TCP
name: http
selector:
{{- include "wg-access-server.selectorLabels" . | nindent 4 }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ $fullName }}-wireguard
labels:
{{- include "wg-access-server.labels" . | nindent 4 }}
{{- if .Values.wireguard.service.annotations }}
annotations:
{{ toYaml .Values.wireguard.service.annotations | indent 4 }}
{{- end }}
spec:
type: {{ .Values.wireguard.service.type }}
sessionAffinity: ClientIP
{{- if .Values.wireguard.service.externalTrafficPolicy }}
externalTrafficPolicy: {{ .Values.wireguard.service.externalTrafficPolicy }}
{{- end }}
{{- if .Values.wireguard.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.wireguard.service.loadBalancerIP }}
{{- end }}
ports:
- port: 51820
targetPort: 51820
protocol: UDP
name: wireguard
selector:
{{- include "wg-access-server.selectorLabels" . | nindent 4 }}