-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:Surveily/Images
- Loading branch information
Showing
4 changed files
with
78 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/sh | ||
|
||
# Run: curl -s https://raw.githubusercontent.com/Surveily/Images/master/script/k3s-wg-init.sh | sudo sh -s -- <ip> | ||
|
||
TXT_YELLOW=`tput setaf 3` | ||
TXT_NORMAL=`tput sgr0` | ||
|
||
set -e | ||
|
||
if [ `whoami` != root ]; then | ||
echo "Please run this script with sudo:" | ||
echo "sudo $0 $*" | ||
exit 1 | ||
fi | ||
|
||
# Disable swap | ||
swapoff -a | ||
sed -i '/swap/s/^\(.*\)$/#\1/g' /etc/fstab | ||
|
||
# Configure K3S | ||
mkdir -p /etc/rancher/k3s | ||
wget -O /etc/rancher/k3s/config.yaml https://raw.githubusercontent.com/Surveily/Images/master/script/k3s/config.yaml | ||
wget -O /etc/multipath.conf https://raw.githubusercontent.com/Surveily/Images/master/script/k3s/multipath.conf | ||
|
||
# Install K3S | ||
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION="v1.27.1+k3s1" sh -s server --disable local-storage --flannel-backend=wireguard-native --flannel-external-ip --node-external-ip=$1 --cluster-init --token "surveily" | ||
|
||
# Configure NVIDIA | ||
k3s kubectl apply -f https://raw.githubusercontent.com/Surveily/Images/master/script/k3s/nvidia.yaml | ||
|
||
# Make sure to `vim /etc/rancher/k3s/config.yaml` and `systemctl start k3s` after this script! | ||
systemctl stop k3s | ||
vim /etc/rancher/k3s/config.yaml | ||
systemctl start k3s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/sh | ||
|
||
# Run: curl -s https://raw.githubusercontent.com/Surveily/Images/master/script/k3s-wg-join-agent.sh | sudo sh -s -- <ip> <ip> | ||
|
||
TXT_YELLOW=`tput setaf 3` | ||
TXT_NORMAL=`tput sgr0` | ||
|
||
set -e | ||
|
||
if [ `whoami` != root ]; then | ||
echo "Please run this script with sudo:" | ||
echo "sudo $0 $*" | ||
exit 1 | ||
fi | ||
|
||
# Disable swap | ||
swapoff -a | ||
sed -i '/swap/s/^\(.*\)$/#\1/g' /etc/fstab | ||
|
||
# Configure K3S | ||
mkdir -p /etc/rancher/k3s | ||
wget -O /etc/rancher/k3s/config.yaml https://raw.githubusercontent.com/Surveily/Images/master/script/k3s/config.yaml | ||
wget -O /etc/multipath.conf https://raw.githubusercontent.com/Surveily/Images/master/script/k3s/multipath.conf | ||
|
||
# Install K3S | ||
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION="v1.27.1+k3s1" K3S_TOKEN="surveily" sh -s agent --node-external-ip=$1 --server https://$2:6443 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
# Run: curl -s https://raw.githubusercontent.com/Surveily/Images/master/script/lxd.sh | sudo bash -s -- <interface> | ||
|
||
set -e | ||
|
||
if [ `whoami` != root ]; then | ||
echo "Please run this script with sudo:" | ||
echo "sudo $0 $*" | ||
exit 1 | ||
fi | ||
|
||
iptables -I DOCKER-USER -i lxdbr0 -j ACCEPT | ||
iptables -I DOCKER-USER -o lxdbr0 -j ACCEPT | ||
iptables -I DOCKER-USER -i lxdbr0 -o $1 -j ACCEPT |