Création d'un cluster K8S sur proxmox
Création de 3 VMS en désactivant le SWAP
- $ free -h.
- $ sudo swapoff -a.
- $ sudo nano /etc/fstab.
- # /dev/sda3 none swap sw 0 0.
- $ sudo swapoff -a.
Installation des outils
-
Update the
apt
package index and install packages needed to use the Kubernetesapt
repository:sudo apt-get update sudo apt-get install -y apt-transport-https ca-certificates curl gpg
-
Download the public signing key for the Kubernetes package repositories. The same signing key is used for all repositories so you can disregard the version in the URL:
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.29/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
Note: In releases older than Debian 12 and Ubuntu 22.04, folder
/etc/apt/keyrings
does not exist by default, and it should be created before the curl command.-
Add the appropriate Kubernetes
apt
repository. If you want to use Kubernetes version different than v1.29, replace v1.29 with the desired minor version in the command below:echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.29/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
Note: To upgrade kubectl to another minor release, you'll need to bump the version in
/etc/apt/sources.list.d/kubernetes.list
before running apt-get update
and apt-get upgrade
. This procedure is described in more detail in Changing The Kubernetes Package Repository.-
Update
apt
package index, then install kubectl:sudo apt-get update sudo apt-get install -y docker.io kubelet kubeadm kubectl kubernetes-cni