Editing
K3s - Kubernetes Simplified
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Install the master nodes === Install the first master node with these commands. This will put it on the node that the command is issued from ... if that is not the desire, remove the '--local' parameter mkdir $HOME/.kube export EXTRA_ARGS="--disable servicelb --disable traefik --disable local-storage --write-kubeconfig-mode=644 --flannel-backend host-gw" \ k3sup install --cluster --local --ip <server-ip-1> --k3s-channel stable --k3s-extra-args '$EXTRA_ARGS' \ --local-path $HOME/.kube/config --tls-san <rr-dns-name> Explanations: * --cluster sets this up for a HA control plane * --local says to do it on this system, instead of using SSH to the node -- '''but you still need to provide the IP address''', otherwise it will put 127.0.0.1 as the API server address * get the last stable version available from k3s (use 'latest' to get bleeding edge updates) * we want to disable the simplified k3s loadbalancer ... it really is a crowbar solution and doesn't provide IP request capability * disable the default ingress controller, as we really want something better * disable the local storage driver (it's a pain if you're installing another storage driver) * make the k3s.yaml file readable by the pods ... really should be by default * (temporary workaround) force the flannel backend to use 'host-gw' mode since 'vxlan' mode seems to be broken with Debian 11 * the --local-path tells k3sup where to put the kubeconfig files ... this is the standard place, so we will put it there. The directory has to exist -- hence the 'mkdir' command ... * by providing the name of the DNS round robin, it should be able to pass muster on TLS connections ... Subsequent master nodes can be installed next: k3sup join --server --host <new master server> --k3s-channel stable --server-host <original master server> --user ewilliam --k3s-extra-args "$EXTRA_ARGS" Explanations: * join as another server, not an agent/worker * provide the hostname of the new master node to be joined * specify the hostname of the first master created * use the same EXTRA_ARGS provided to the first server Repeat this for all the masters (minimum 3) providing the same server IP address of the first master. Note that if you need to add/remove more parameters to the k3s service, you need to do it on all server nodes -- just edit the k3s.service file and restart one server at a time. Now that you have all the masters online, reset the kubeconfig file (~/.kube/config) to use the common name through the reverse proxy or DNS Round Robin instead of the IP of the first master: sed -i -e s/<server-ip-1>/<common-name>/g $HOME/.kube/config
Summary:
Please note that all contributions to WilliamsNet Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
WilliamsNet Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Navigation
Commons
Architecture
How-To
Systems
Hardware
SysAdmin
Kubernetes
OpenSearch
Special
Pages to create
All pages
Recent changes
Random page
Help about MediaWiki
Formatting Help
Tools
What links here
Related changes
Special pages
Page information