- Generate a list of instances
sbin/generate-instance-list.sh -n mak3r-rancher-training-k3s > instance-ids.json
- use a script to connect to those instances by list id
sbin/ssh-connect.sh -i 0 -k ~/.ssh/mak3r-private.pem -s
- Get the cloud server public IP address and replace throughout the script
- Prepare a local RPi server
/Users/markabrams/dev/k3s-training/sbin/ssh-connect.sh -i 2 -k ~/.ssh/mak3r-private.pem -s
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v0.3.0 sh -
kubectl version
k3s --version
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v0.7.0-rc4 sh -
kubectl version
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v0.7.0-rc4 INSTALL_K3S_EXEC="--write-kubeconfig-mode 644" sh -
kubectl version
k3s --version
curl -sfL https://get.k3s.io | sh -
kubectl version
k3s --version
sudo /usr/local/bin/k3s-uninstall.sh
Login to the server (aws)
/Users/markabrams/dev/k3s-training/sbin/ssh-connect.sh -i 2 -k ~/.ssh/mak3r-private.pem -s
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--disable-agent --write-kubeconfig-mode 644 --tls-san 54.196.155.129" sh -
echo "export node_token=$(sudo cat /var/lib/rancher/k3s/server/node-token)"
- copy the output of the prior command
- X86
/Users/markabrams/dev/k3s-training/sbin/ssh-connect.sh -i 3 -k ~/.ssh/mak3r-private.pem -s
curl -L -o k3s https://github.com/rancher/k3s/releases/download/v0.6.1/k3s
chmod 755 k3s && sudo mv k3s /usr/local/bin/k3s
- Paste output of
export node_token ...
command sudo /usr/local/bin/k3s agent --server https://54.196.155.129:6443 --token "$node_token" >& k3s-agent.log &
- ARM
/Users/markabrams/dev/k3s-training/sbin/ssh-connect.sh -i 0 -k ~/.ssh/mak3r-private.pem -s
curl -L -o k3s https://github.com/rancher/k3s/releases/download/v0.6.1/k3s-arm64
chmod 755 k3s && sudo mv k3s /usr/local/bin/k3s
- Paste output of
export node_token ...
command sudo /usr/local/bin/k3s agent --server https://54.196.155.129:6443 --token "$node_token" >& k3s-agent.log &
Login to the local node (RPi)
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--write-kubeconfig-mode 644" sh -
htop
vi nginx.yaml
kubectl apply -f nginx.yaml
kubectl get pods --all-namespaces
kubectl delete -f nginx.yaml
vi nginx.yaml
sudo cp nginx.yaml /var/lib/rancher/k3s/server/manifests/.
k3d create --name cluster01 --workers 3
KUBECONFIG="$(k3d get-kubeconfig --name='cluster01')"; kubectl get node
k3d delete -a
packer build k3os.json
vagrant up
vagrant ssh
- Retrieve the cluster kubectl command. Run it in the first cluster
rancher cluster create --import k3s01
rancher cluster import -q k3s01
- run output in the cluster to be imported
sudo ps aux | grep k3s | awk '{print $2}' | sudo xargs kill
sudo rm /usr/local/bin/k3s
sudo /usr/local/bin/k3s-uninstall.sh