1
0
Fork 0
mirror of synced 2024-11-19 15:25:36 -05:00
ovpn-admin/helm/templates/service.yaml

56 lines
1.4 KiB
YAML
Raw Normal View History

2022-01-29 07:47:26 -05:00
apiVersion: v1
kind: Service
metadata:
2022-11-09 14:48:08 -05:00
name: {{ include "ovpn-admin-chart.fullname" . }}
labels:
{{- include "ovpn-admin-chart.labels" . | nindent 4 }}
2022-01-29 07:47:26 -05:00
spec:
2022-11-09 14:48:08 -05:00
type: {{ .Values.service.openvpnAdmin.type }}
2022-01-29 07:47:26 -05:00
ports:
2022-11-09 14:48:08 -05:00
- port: {{ .Values.service.openvpnAdmin.port }}
targetPort: http
protocol: TCP
name: http
2022-01-29 07:47:26 -05:00
selector:
2022-11-09 14:48:08 -05:00
{{- include "ovpn-admin-chart.selectorLabels" . | nindent 4 }}
2022-01-29 07:47:26 -05:00
2022-11-09 14:48:08 -05:00
{{- if eq .Values.service.openvpn.connectionType "LoadBalancer"}}
2022-01-29 07:47:26 -05:00
---
apiVersion: v1
kind: Service
metadata:
name: openvpn-external
2022-11-09 14:48:08 -05:00
labels:
{{- include "ovpn-admin-chart.labels" . | nindent 4 }}
2022-01-29 07:47:26 -05:00
spec:
externalTrafficPolicy: Local
2022-11-09 14:48:08 -05:00
type: {{ .Values.service.openvpn.type }}
2022-01-29 07:47:26 -05:00
ports:
2022-11-09 14:48:08 -05:00
- port: {{ .Values.service.openvpn.port }}
2022-01-29 07:47:26 -05:00
targetPort: openvpn-tcp
2022-11-09 14:48:08 -05:00
protocol: TCP
name: openvpn-tcp
2022-01-29 07:47:26 -05:00
selector:
2022-11-09 14:48:08 -05:00
{{- include "ovpn-admin-chart.selectorLabels" . | nindent 4 }}
{{- else if eq .Values.service.openvpn.connectionType "ExternalIP" }}
2022-01-29 07:47:26 -05:00
---
apiVersion: v1
kind: Service
metadata:
name: openvpn-external
2022-11-09 14:48:08 -05:00
labels:
{{- include "ovpn-admin-chart.labels" . | nindent 4 }}
2022-01-29 07:47:26 -05:00
spec:
2022-11-09 14:48:08 -05:00
externalTrafficPolicy: Local
2022-01-29 07:47:26 -05:00
type: ClusterIP
externalIPs:
2022-11-09 14:48:08 -05:00
- {{ .Values.service.openvpn.externalIP }}
2022-01-29 07:47:26 -05:00
ports:
2022-11-09 14:48:08 -05:00
- port: {{ .Values.service.openvpn.externalPort }}
targetPort: openvpn-tcp
protocol: TCP
name: openvpn-tcp
2022-01-29 07:47:26 -05:00
selector:
2022-11-09 14:48:08 -05:00
{{- include "ovpn-admin-chart.selectorLabels" . | nindent 4 }}
{{- end -}}