Aller au contenu

Installation de k3s

Attention

Assurez-vous d’avoir bien suivi les étapes précédentes de la procédure avant de lancer l’installation de k3s.

Récupération du script d'installation

cd /tmp
wget https://get.k3s.io/inst-k3s.sh

Lancement de l'installation

chmod +x inst-k3s.sh
./inst-k3s.sh
[INFO]  Finding release for channel stable
[INFO]  Using v1.36.4+k3s1 as release
[INFO]  Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.36.4%2Bk3s1/sha256sum-arm64.txt
[INFO]  Downloading binary https://github.com/k3s-io/k3s/releases/download/v1.36.4%2Bk3s1/k3s-arm64
...
...
[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]  Host iptables-save/iptables-restore tools not found
[INFO]  Host ip6tables-save/ip6tables-restore tools not found
[INFO]  systemd: Starting k3s

Vérification

export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
kubectl get nodes
NAME             STATUS   ROLES           AGE     VERSION
k3s.gmolab.net   Ready    control-plane   2m25s   v1.36.4+k3s1

Accès à l'API depuis un autre serveur/poste de travail

Pour gérer le serveur k3s avec des clients tels que kubectl, k9s, etc., il faut récupérer le fichier /etc/rancher/k3s/k3s.yaml du serveur k3s et le copier dans le fichier de configuration ~/.kube/config de l’utilisateur.

Nettoyage

cd
rm -rf /tmp/inst-k3s.sh

Version Date Change Auteur
1.0 19.09.2026 Création GMo