@@ -8,10 +8,7 @@ app-template:
8
8
tag : latest
9
9
env :
10
10
LOG_CONFS : false
11
- PEERS : |
12
- KDDesktop
13
- KDLaptop
14
- KDPhone
11
+ USE_COREDNS : true
15
12
securityContext :
16
13
capabilities :
17
14
add :
@@ -25,8 +22,57 @@ app-template:
25
22
port : 51820
26
23
protocol : UDP
27
24
persistence :
28
- data :
29
- accessMode : ReadWriteOnce
30
- size : 10Mi
25
+ config :
26
+ type : secret
27
+ name : " {{ .Release.Name }}-secret "
31
28
globalMounts :
32
- - path : /config
29
+ - path : /config/wg_confs
30
+ rawResources :
31
+ secret :
32
+ apiVersion : external-secrets.io/v1beta1
33
+ kind : ExternalSecret
34
+ spec :
35
+ spec :
36
+ secretStoreRef :
37
+ kind : ClusterSecretStore
38
+ name : global-secrets
39
+ data :
40
+ - secretKey : WIREGUARD_PRIVATE_KEY
41
+ remoteRef :
42
+ key : external
43
+ property : wireguard-private-key
44
+ target :
45
+ template :
46
+ data :
47
+ wg0.conf : |
48
+ [Interface]
49
+ Address = 172.16.0.1/32
50
+ ListenPort = 51820
51
+ PrivateKey = {{ `{{ .WIREGUARD_PRIVATE_KEY }}` }}
52
+ PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth+ -j MASQUERADE
53
+ PostDown = iptables -D FORWARD -i %i -j ACCEPT; iptables -D FORWARD -o %i -j ACCEPT; iptables -t nat -D POSTROUTING -o eth+ -j MASQUERADE
54
+
55
+ # Note that WireGuard will ignore a peer whose public key matches
56
+ # the interface's private key. So you can distribute a single
57
+ # list of peers everywhere.
58
+ # https://lists.zx2c4.com/pipermail/wireguard/2018-December/003703.html
59
+
60
+ [Peer]
61
+ # homelab
62
+ PublicKey = sSAZS1Z3vB7Wx8e2yVqXfeHjgWTa80wnSYoma3mZkiU=
63
+ AllowedIPs = 172.16.0.1/32, 192.168.1.224/27
64
+
65
+ [Peer]
66
+ # khuedoan-ryzentower
67
+ PublicKey = 2poJnXVSbbaqY90B6ruupKEO4OrDFCur2s2pqTk1HWE=
68
+ AllowedIPs = 172.16.0.10/32
69
+
70
+ [Peer]
71
+ # khuedoan-thinkpadz13
72
+ PublicKey = kgQbzrz+/P3Xd+L2hseKDYUjhwgfuQOro6tNz11ePH4=
73
+ AllowedIPs = 172.16.0.11/32
74
+
75
+ [Peer]
76
+ # khuedoan-phone
77
+ PublicKey = nITHFdgTkNZOTWeSWqnGXjgwlCJMKRCnnUsjMx2yp2U=
78
+ AllowedIPs = 172.16.0.12/32
0 commit comments