User Tools

Site Tools


container:kubernetes:k3s_update

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
container:kubernetes:k3s_update [2020/12/07 16:27] – created stonecontainer:kubernetes:k3s_update [2021/01/11 14:58] (current) – [Via Installations Script] stone
Line 1: Line 1:
 ====== Update vom K3s Cluster ====== ====== Update vom K3s Cluster ======
-....+Ein Upgrade ist im Grunde ganz einfach\\ 
 +Es gibt verschiedene Möglichkeiten 
 +  * Via Installations Script 
 +  * Voll Automatisch via - system-upgrade-controller 
 +  * Manuell 
 + 
 +\\ 
 +Aktuell gehe ich nur die Version via Installations Script und Manuell ein\\ 
 +Mir persönlich ist die manuelle Version lieberDaher auch hier als erstes angeführt 
 +\\ 
 + 
 +===== Manuelles Upgrade ===== 
 +Hier benötigt man keine Infos über die Parameter bei der Installation oder sonst etwas. \\ 
 + 
 + 
 +==== Download der neuen Version suchen ==== 
 +[[https://github.com/k3s-io/k3s/releases|https://github.com/k3s-io/k3s/releases]] 
 +\\ 
 + 
 +==== Backup der atkuellen Version ==== 
 +<code> 
 +cp -a /usr/local/bin/k3s /usr/local/bin/k3s_v1.19.5 
 +</code> 
 +\\ 
 + 
 +==== Stoppen einer Node ==== 
 +<code> 
 +systemctl stop k3s* 
 +/usr/local/bin/k3s-killall.sh 
 +systemctl status k3s* 
 +</code> 
 +\\ 
 + 
 +==== Update einer Node ==== 
 +<code> 
 +cd /usr/local/bin/ 
 +wget -O k3s https://github.com/k3s-io/k3s/releases/download/v1.20.0%2Bk3s2/k3s 
 +</code> 
 +\\ 
 + 
 +==== Starten einer Master Node ==== 
 +<code> 
 +systemctl start k3s.service 
 +systemctl status k3s.service 
 +</code> 
 +\\ 
 + 
 +==== Starten einer Worker Node ==== 
 +<code> 
 +systemctl start k3s-agent.service 
 +systemctl status k3s-agent.service 
 +</code> 
 + 
 +\\ 
 +---- 
 + 
 + 
 + 
 +===== Via Installations Script ===== 
 +Es ist wichtig das man die Parameter vom installieren noch weiß da man diese hier wieder anwenden muss! \\ 
 +Die Parameter vom Update werden wieder in den Scripten zum Starten von K3s übernommen. 
 +\\ 
 +Das Upgrade funktioniert genau wie eine Installation auch. 
 +<code> 
 +Beispiel: 
 +curl -sfL https://get.k3s.io | sh - 
 +</code> 
 +Hier sollten aber wie gesagt die Parameter von jeder Node bei der Installation berücksichtigt werden. 
 +\\ 
 +\\ 
 + 
 +==== Upgrade K3s Using the Installations Script - Master Node ==== 
 +<code> 
 +root@kube01:~# kubectl get nodes 
 +NAME     STATUS   ROLES    AGE   VERSION 
 +kube01   Ready    master   13d   v1.19.4+k3s1 
 +kube02   Ready    <none>   13d   v1.19.4+k3s1 
 +kube03   Ready    <none>   13d   v1.19.4+k3s1 
 + 
 + 
 +export INSTALL_K3S_EXEC="--disable servicelb --disable traefik" 
 +curl -sfL https://get.k3s.io | sh - 
 +[INFO]  Finding release for channel stable 
 +[INFO]  Using v1.19.5+k3s2 as release 
 +[INFO]  Downloading hash https://github.com/rancher/k3s/releases/download/v1.19.5+k3s2/sha256sum-amd64.txt 
 +[INFO]  Downloading binary https://github.com/rancher/k3s/releases/download/v1.19.5+k3s2/k3s 
 +[INFO]  Verifying binary download 
 +[INFO]  Installing k3s to /usr/local/bin/k3s 
 +[INFO]  Skipping /usr/local/bin/kubectl symlink to k3s, already exists 
 +[INFO]  Skipping /usr/local/bin/crictl symlink to k3s, already exists 
 +[INFO]  Skipping /usr/local/bin/ctr symlink to k3s, already exists 
 +[INFO]  Creating killall script /usr/local/bin/k3s-killall.sh 
 +[INFO]  Creating uninstall script /usr/local/bin/k3s-uninstall.sh 
 +[INFO]  env: Creating environment file /etc/systemd/system/k3s.service.env 
 +[INFO]  systemd: Creating service file /etc/systemd/system/k3s.service 
 +[INFO]  systemd: Enabling k3s unit 
 +Created symlink /etc/systemd/system/multi-user.target.wants/k3s.service → /etc/systemd/system/k3s.service. 
 +[INFO]  systemd: Starting k3s 
 + 
 + 
 +root@kube01:~# kubectl get nodes 
 +NAME     STATUS   ROLES    AGE   VERSION 
 +kube01   Ready    master   13d   v1.19.5+k3s2 
 +kube02   Ready    <none>   13d   v1.19.4+k3s1 
 +kube03   Ready    <none>   13d   v1.19.4+k3s1 
 +</code> 
 +\\ 
 + 
 +==== Upgrade K3s Using the Installations Script - Slave Node ==== 
 +<code> 
 +curl -sfL https://get.k3s.io | sh - 
 + 
 + 
 +</code>
  
container/kubernetes/k3s_update.1607358478.txt.gz · Last modified: by stone