Skip to content

Instantly share code, notes, and snippets.

Last active Jul 3, 2020
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=
export AGENT_1_IP=
export AGENT_2_IP=
export AGENT_3_IP=
export AGENT_4_IP=
export AGENT_5_IP=
ssh $USER@$SERVER_IP 'curl -sLS | 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