forked from swisscom/kubeone-dcs-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwireguard.sh
More file actions
executable file
·29 lines (26 loc) · 1.14 KB
/
Copy pathwireguard.sh
File metadata and controls
executable file
·29 lines (26 loc) · 1.14 KB
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
#!/bin/bash
set -e
set -u
set -o pipefail
if [[ "$(basename ${PWD})" == "deployments" ]]; then
cd ..
fi
# chart source: ./wireguard
repository="-"
chart="wireguard"
version="0.0.1"
namespace="${chart}"
wireguard_server_address=$(yq -e eval '.kubernetes.wireguard.serverAddress // "10.242.42.1/24"' config.yaml)
wireguard_server_key=$(yq -e eval '.kubernetes.wireguard.privateKey' config.yaml)
cat > "deployments/${chart}.values.yaml" <<EOF
wireguard:
serverAddress: ${wireguard_server_address}
privateKey: ${wireguard_server_key}
clients: []
EOF
yq -e eval '.wireguard.clients = (load("config.yaml") | .kubernetes.wireguard.clients // [])' -i "deployments/${chart}.values.yaml"
deployments/install-chart.sh "${repository}" "${chart}" "${namespace}" "${version}" "deployments/${chart}.values.yaml"
echo " "
echo "================================================================================================================="
echo "WireGuard VPN has been installed, consult the README.md on how to configure your local wg0 interface"
echo "================================================================================================================="