Skip to content

Instantly share code, notes, and snippets.

@jgavinray
Last active Jul 3, 2020
Embed
What would you like to do?
Install K3s from scratch - from local machine
# Assumptions below:
# Your local user has ssh access to the server and agent machines
# Your user on those machines is a sudo user with NOPASSWD configured
export USER=$(whoami)
export SERVER_IP=192.168.0.25
export AGENT_1_IP=192.168.0.26
export AGENT_2_IP=192.168.0.27
export AGENT_3_IP=192.168.0.28
export AGENT_4_IP=192.168.0.29
export AGENT_5_IP=192.168.0.30
ssh $USER@$SERVER_IP 'curl -sLS https://get.k3sup.dev | sh'
ssh $USER@$SERVER_IP 'sudo install k3sup /usr/local/bin/'
ssh $USER@$SERVER_IP "k3sup install --ip $SERVER_IP --user $USER"
ssh $USER@$SERVER_IP "k3sup join --ip $AGENT_1_IP --server-ip $SERVER_IP --user $USER"
ssh $USER@$SERVER_IP "k3sup join --ip $AGENT_2_IP --server-ip $SERVER_IP --user $USER"
ssh $USER@$SERVER_IP "k3sup join --ip $AGENT_3_IP --server-ip $SERVER_IP --user $USER"
ssh $USER@$SERVER_IP "k3sup join --ip $AGENT_4_IP --server-ip $SERVER_IP --user $USER"
ssh $USER@$SERVER_IP "k3sup join --ip $AGENT_5_IP --server-ip $SERVER_IP --user $USER"
ssh $USER@$SERVER_IP 'cat ~/kubeconfig'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment