58 lines
1.1 KiB
YAML
58 lines
1.1 KiB
YAML
|
---
|
||
|
apiVersion: v1
|
||
|
kind: Service
|
||
|
metadata:
|
||
|
name: ovpn-admin
|
||
|
spec:
|
||
|
clusterIP: None
|
||
|
ports:
|
||
|
- name: http
|
||
|
port: 8000
|
||
|
protocol: TCP
|
||
|
targetPort: 8000
|
||
|
selector:
|
||
|
app: openvpn
|
||
|
---
|
||
|
{{- if hasKey .Values.openvpn "inlet" }}
|
||
|
|
||
|
{{- if eq .Values.openvpn.inlet "LoadBalancer" }}
|
||
|
---
|
||
|
apiVersion: v1
|
||
|
kind: Service
|
||
|
metadata:
|
||
|
name: openvpn-external
|
||
|
spec:
|
||
|
externalTrafficPolicy: Local
|
||
|
type: LoadBalancer
|
||
|
ports:
|
||
|
- name: openvpn-tcp
|
||
|
protocol: TCP
|
||
|
port: {{ .Values.openvpn.externalPort | default 1194 }}
|
||
|
targetPort: openvpn-tcp
|
||
|
selector:
|
||
|
app: openvpn
|
||
|
{{- else if eq .Values.openvpn.inlet "ExternalIP" }}
|
||
|
---
|
||
|
apiVersion: v1
|
||
|
kind: Service
|
||
|
metadata:
|
||
|
name: openvpn-external
|
||
|
spec:
|
||
|
type: ClusterIP
|
||
|
externalIPs:
|
||
|
- {{ .Values.openvpn.externalIP }}
|
||
|
ports:
|
||
|
- name: openvpn-tcp
|
||
|
port: {{ .Values.openvpn.externalPort | default 1194 }}
|
||
|
protocol: TCP
|
||
|
targetPort: openvpn-tcp
|
||
|
selector:
|
||
|
app: openvpn
|
||
|
{{- else if eq .Values.openvpn.inlet "HostPort" }}
|
||
|
---
|
||
|
{{- else }}
|
||
|
{{- cat "Unsupported inlet type" .inlet | fail }}
|
||
|
{{- end }}
|
||
|
|
||
|
{{- end }}
|