Browse Source

loadbalancer reformat and annotations

Vadim Surkov 2 years ago
parent
commit
90420d2cb8
2 changed files with 19 additions and 11 deletions
  1. 8 4
      helm/templates/service.yaml
  2. 11 7
      helm/values.yaml

+ 8 - 4
helm/templates/service.yaml

@@ -1,16 +1,20 @@
-{{- if and .Values.inbound_IP .Values.inbound_port }}
+{{- if and .Values.service.ip .Values.service.port }}
 apiVersion: v1
 kind: Service
 metadata:
   name: {{ .Release.Name }}-ingress
+  {{- if .Values.service.annotations }}
+  annotations:
+    {{- .Values.service.annotations | toYaml | nindent 4 }}
+  {{- end }}
 spec:
   type: LoadBalancer
   selector:
     {{- include "openvpn.selectorLabels" . | nindent 4 }}
   ports:
   - name: ingress
-    protocol: {{ .Values.inbound_proto | default "UDP" | upper }}
-    port: {{ .Values.inbound_port }}
-  loadBalancerIP: {{ .Values.inbound_IP }}
+    protocol: {{ .Values.service.proto | default "UDP" | upper }}
+    port: {{ .Values.service.port }}
+  loadBalancerIP: {{ .Values.service.ip }}
   externalTrafficPolicy: Local
 {{- end }}

+ 11 - 7
helm/values.yaml

@@ -61,13 +61,17 @@ openvpn:
   #   #!/bin/bash
   #   echo state | nc localhost 7505 | grep -i connected
 
-# Inbound IP and port
-# ip, port and protocol for loadbalancer service, in case it's a server
-inbound_IP: 192.168.21.75
-# must be same, as port in openvpn config
-inbound_port: 1194
-# must be same, as proto in openvpn config
-inbound_proto: UDP
+service:
+  # Loadbalancer IP and port
+  # ip, port and protocol for loadbalancer service, in case it's a server
+  ip: 192.168.21.75
+  # must be same, as port in openvpn config
+  port: 1194
+  # must be same, as proto in openvpn config
+  proto: UDP
+  # annotations
+  annotations: {}
+  #  metallb.universe.tf/allow-shared-ip: openvpn-ip
 
 # Virtual flow ip for openvpn service
 virtIP_addr: 192.168.21.71