-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.yaml
72 lines (72 loc) · 1.85 KB
/
deploy.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
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
meta.helm.sh/release-name: wireguard
labels:
name: wireguard
namespace: default
spec:
selector:
matchLabels:
app: wireguard
template:
metadata:
labels:
app: wireguard
spec:
containers:
- env:
- name: TZ
value: {Your Time Zone}
- name: PEERS
value: user1,user2
- name: PUID
value: '1000'
- name: PGID
value: '1000'
- name: ALLOWEDIPS
value: 0.0.0.0/0
- name: SERVERPORT
value: {Your Server Port}
- name: SERVERURL
value: {Your Server URL}
image: linuxserver/wireguard:latest
name: wireguard
ports:
- containerPort: 51820
securityContext:
capabilities:
add:
- NET_ADMIN
- SYS_MODULE
privileged: true
volumeMounts:
- mountPath: "/config/"
name: wireguard-config
imagePullSecrets:
- name: docker-registry
initContainers:
- command:
- sh
- "-c"
- ENI=$(ip route get 8.8.8.8 | grep 8.8.8.8 | awk '{print $5}'); sed "s/ENI/$ENI/g"
/etc/wireguard-secret/wg0.conf.template > /config/wg0.conf; chmod 400 /config/wg0.conf
- sysctl -w net.ipv4.ip_forward=1
image: busybox
name: wireguard-template-replacement
volumeMounts:
- mountPath: "/config/"
name: wireguard-config
- mountPath: "/etc/wireguard-secret/"
name: wireguard-secret
volumes:
# Uncomment for using PV
# - persistentVolumeClaim:
# claimName: wireguard-pvc
# name: wireguard-config
- emptyDir: {}
name: wireguard-config
- name: wireguard-secret
secret:
secretName: wireguard