Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Surveily/Images
Browse files Browse the repository at this point in the history
  • Loading branch information
Maksymilian Mazurkiewicz committed Oct 16, 2024
2 parents 7a702f9 + cd3375f commit bd4e3f8
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 3 deletions.
6 changes: 3 additions & 3 deletions script/full-22.04.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ FILE=/surveily-k3s
if [ -f $FILE ]; then
echo "File $FILE exists."
else
echo "File $FILE not exists."
curl -s https://raw.githubusercontent.com/Surveily/Images/master/script/k3s-multi-agent.sh | sh -s -- 10.100.1.10
#echo "File $FILE not exists."
#curl -s https://raw.githubusercontent.com/Surveily/Images/master/script/k3s-multi-agent.sh | sh -s -- 10.100.1.10
touch $FILE
reboot
#reboot
fi
34 changes: 34 additions & 0 deletions script/k3s-wg-init.sh
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
26 changes: 26 additions & 0 deletions script/k3s-wg-join-agent.sh
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
15 changes: 15 additions & 0 deletions script/lxd.sh
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

0 comments on commit bd4e3f8

Please sign in to comment.