1
0
Fork 0
mirror of synced 2024-11-19 15:25:36 -05:00
ovpn-admin/helm/templates/service.yaml
2022-11-09 22:48:08 +03:00

56 lines
No EOL
1.4 KiB
YAML

apiVersion: v1
kind: Service
metadata:
name: {{ include "ovpn-admin-chart.fullname" . }}
labels:
{{- include "ovpn-admin-chart.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.openvpnAdmin.type }}
ports:
- port: {{ .Values.service.openvpnAdmin.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "ovpn-admin-chart.selectorLabels" . | nindent 4 }}
{{- if eq .Values.service.openvpn.connectionType "LoadBalancer"}}
---
apiVersion: v1
kind: Service
metadata:
name: openvpn-external
labels:
{{- include "ovpn-admin-chart.labels" . | nindent 4 }}
spec:
externalTrafficPolicy: Local
type: {{ .Values.service.openvpn.type }}
ports:
- port: {{ .Values.service.openvpn.port }}
targetPort: openvpn-tcp
protocol: TCP
name: openvpn-tcp
selector:
{{- include "ovpn-admin-chart.selectorLabels" . | nindent 4 }}
{{- else if eq .Values.service.openvpn.connectionType "ExternalIP" }}
---
apiVersion: v1
kind: Service
metadata:
name: openvpn-external
labels:
{{- include "ovpn-admin-chart.labels" . | nindent 4 }}
spec:
externalTrafficPolicy: Local
type: ClusterIP
externalIPs:
- {{ .Values.service.openvpn.externalIP }}
ports:
- port: {{ .Values.service.openvpn.externalPort }}
targetPort: openvpn-tcp
protocol: TCP
name: openvpn-tcp
selector:
{{- include "ovpn-admin-chart.selectorLabels" . | nindent 4 }}
{{- end -}}