-
Notifications
You must be signed in to change notification settings - Fork 2
/
wireguard.yaml
103 lines (103 loc) · 2.28 KB
/
wireguard.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
apiVersion: v1
kind: Namespace
metadata:
name: wireguard
---
apiVersion: v1
kind: ConfigMap
metadata:
name: wireguard-config
namespace: wireguard
data:
PUID: "1000"
PGID: "1000"
TZ: "Pacific/Auckland"
SERVERPORT: "51820"
SERVERURL: "wireguard.${SHARINGIO_PAIR_BASE_DNS_NAME}"
PEERS: "5"
# PEERDNS: "10.43.0.30"
PEERDNS: "auto"
ALLOWEDIPS: "0.0.0.0/0, ::/0"
INTERNAL_SUBNET: "10.13.13.0"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: wireguard
namespace: wireguard
labels:
app: wireguard
spec:
replicas: 1
selector:
matchLabels:
app: wireguard
template:
metadata:
labels:
app: wireguard
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: app
operator: In
values:
- wireguard
topologyKey: "kubernetes.io/hostname"
containers:
- name: wireguard
image: docker.io/linuxserver/wireguard:v1.0.20210424-ls36
envFrom:
- configMapRef:
name: wireguard-config
securityContext:
capabilities:
add:
- NET_ADMIN
- SYS_MODULE
privileged: true
volumeMounts:
- name: wg-config
mountPath: /config
- name: host-volumes
mountPath: /lib/modules
ports:
- containerPort: 51820
protocol: UDP
resources:
requests:
memory: "64Mi"
cpu: "10m"
limits:
memory: "128Mi"
cpu: "100m"
volumes:
- name: wg-config
hostPath:
path: /home/ii/.config/wireguard
- name: host-volumes
hostPath:
path: /lib/modules
type: Directory
---
apiVersion: v1
kind: Service
metadata:
name: wireguard
namespace: wireguard
spec:
selector:
app: wireguard
ports:
- name: wireguard
port: 51820
targetPort: 51820
protocol: UDP
externalTrafficPolicy: Local
type: LoadBalancer
externalIPs:
- ${SHARINGIO_PAIR_LOAD_BALANCER_IP}
- ${MACHINE_IP}