Skip to content

Commit f1ca83b

Browse files
authored
feat(ipv6): new value forwardIPv6 sets sysctl net.ipv6.conf.all.forwarding (#81)
Updates the original branch introduced by #80 and bumps the versions and updates the docs. Relates to #64
2 parents 9fecf0d + 00277d5 commit f1ca83b

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

helm/wireguard/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: wireguard
33
description: A Helm chart for managing a wireguard vpn in kubernetes
44
type: application
5-
version: 0.30.0
5+
version: 0.31.0
66
appVersion: "0.0.0"
77
maintainers:
88
- name: bryopsida

helm/wireguard/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# wireguard
22

3-
![Version: 0.30.0](https://img.shields.io/badge/Version-0.30.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.0](https://img.shields.io/badge/AppVersion-0.0.0-informational?style=flat-square)
3+
![Version: 0.31.0](https://img.shields.io/badge/Version-0.31.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.0](https://img.shields.io/badge/AppVersion-0.0.0-informational?style=flat-square)
44

55
A Helm chart for managing a wireguard vpn in kubernetes
66

@@ -143,6 +143,7 @@ A Helm chart for managing a wireguard vpn in kubernetes
143143
| service.enabled | bool | `true` | Whether the service will be created or not |
144144
| service.externalTrafficPolicy | string | `""` | External Traffic Policy for the service |
145145
| service.extraPorts | list | `[]` | Extra ports that can be attached to the service object, these are passed directly to the port array on the service and must be well formed to the specification |
146+
| service.ipFamilyPolicy | string | `"SingleStack"` | ipFamilyPolicy enables single or dual stack services |
146147
| service.loadBalancerClass | string | `""` | loadBalancerClass for Service Controllers that support it |
147148
| service.loadBalancerIP | string | `""` | IP to assign to the LoadBalancer service |
148149
| service.nodePort | int | `31820` | Node port, only valid with service type: NodePort |
@@ -153,6 +154,7 @@ A Helm chart for managing a wireguard vpn in kubernetes
153154
| volumeMounts | object | `{}` | Passthrough pod volume mounts |
154155
| volumes | object | `{}` | Passthrough pod volumes |
155156
| wireguard.clients | list | `[]` | A collection of clients that will be added to wg0.conf, accepts objects with keys PublicKey and AllowedIPs (mandatory) and optional FriendlyName or FriendlyJson (https://github.com/MindFlavor/prometheus_wireguard_exporter#friendly-tags) and PersistentKeepalive (https://www.wireguard.com/quickstart/#nat-and-firewall-traversal-persistence), stored in secret |
157+
| wireguard.forwardIPv6 | bool | `false` | If true, calls sysctl -w net.ipv6.conf.all.forwarding=1 |
156158
| wireguard.interfaceOpts | object | `{}` | A collection of extraopts for wireguard interface |
157159
| wireguard.natAddSourceNet | bool | `true` | Add the serverCidr to the nat source net option |
158160
| wireguard.serverAddress | string | `"10.34.0.1/24"` | Address of the VPN server |

helm/wireguard/templates/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,11 @@ spec:
134134
command:
135135
- sh
136136
- -c
137+
{{- if .Values.forwardIPv6 }}
138+
- sysctl -w net.ipv4.ip_forward=1 && sysctl -w net.ipv4.conf.all.forwarding=1 && sysctl -w net.ipv6.conf.all.forwarding=1
139+
{{- else }}
137140
- sysctl -w net.ipv4.ip_forward=1 && sysctl -w net.ipv4.conf.all.forwarding=1
141+
{{- end }}
138142
securityContext: {{ include "init.securitycontext" . | nindent 12 }}
139143
resources: {{ .Values.initContainer.resources | toYaml | nindent 12 }}
140144
containers:

helm/wireguard/templates/service.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,7 @@ spec:
3333
{{- if and .Values.service.loadBalancerClass (semverCompare ">=1.24-0" .Capabilities.KubeVersion.Version) }}
3434
loadBalancerClass: {{ .Values.service.loadBalancerClass }}
3535
{{- end }}
36-
{{- end }}
36+
{{- if .Values.service.ipFamilyPolicy }}
37+
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
38+
{{- end }}
39+
{{- end }}

helm/wireguard/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ wireguard:
8585
# PublicKey: QTxoajwVHWZ7qqVwY2F9T1L04M0j5GSNC15++LZw1iA=
8686
# # Normally PersistentKeepalive is not required
8787
# #PersistentKeepalive: 25
88+
# -- If true, calls sysctl -w net.ipv6.conf.all.forwarding=1
89+
forwardIPv6: false
8890
securityContext:
8991
runAsNonRoot: true
9092
runAsUser: 1000
@@ -110,6 +112,8 @@ service:
110112
extraPorts: []
111113
# -- loadBalancerClass for Service Controllers that support it
112114
loadBalancerClass: ""
115+
# -- ipFamilyPolicy enables single or dual stack services
116+
ipFamilyPolicy: "SingleStack"
113117
# -- Name of a secret with a wireguard private key on key privatekey, if not provided on first install a hook generates one.
114118
secretName: ~
115119
replicaCount: 3

0 commit comments

Comments
 (0)