Outils pour utilisateurs

Outils du site


tech:notes_kubernetes_k8s_-_install_node

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
tech:notes_kubernetes_k8s_-_install_node [2025/05/27 10:20] Jean-Baptistetech:notes_kubernetes_k8s_-_install_node [2026/06/07 19:12] (Version actuelle) – modification externe 127.0.0.1
Ligne 1: Ligne 1:
 +<!DOCTYPE markdown>
 +{{tag>Brouillon K8S}}
 +
 +# Notes Kubernetes k8s - Install Node
 +
 +
 +## Prérequis
 +
 +Prérequis :
 + * Unique mac addresses et `/sys/class/dmi/id/product_uuid`
 + * Pas de swap
 +
 +
 +
 +### Debian
 +
 +Voir : 
 +* https://cyril.deguet.com/fr/2018/02/12/kubernetes-debian-vps/
 +* https://www.digitalocean.com/community/tutorials/how-to-create-a-kubernetes-cluster-using-kubeadm-on-debian-9
 +* https://gist.github.com/apokalyptik/99cefb3d2e16b9b0c3141e222f3267db
 +* https://www.server-world.info/en/note?os=Debian_10&p=kubernetes&f=3
 +* https://www.nuxeo.com/fr/blog/installing-kubernetes-moving-from-physical-servers-to-containers/
 +
 +
 +### Generic all Debians
 +
 +~~~bash
 +# generic
 +apt-get install -y yq vim atop tmux sudo
 +
 +# for apt-get
 +apt-get install -y apt-transport-https ca-certificates curl gpg
 +~~~
 +
 +A faire : 
 + * Changer hostname
 + * Mettre à jour `/etc/hosts`
 + * Copier la clef SSH `ssh-copy-id`
 + * @ip /etc/network/interfaces.d/vlan100 ou netplan
 +
 +
 +~~~bash
 +apt-get install
 +apt-get install network-manager
 +~~~
 +
 +`/etc/netplan/00-network-manager.yaml`
 +~~~yaml
 +network:
 +  version: 2
 +  renderer: NetworkManager
 +~~~
 +
 +
 +** Netplan avec NetworkManager bug -- Solution : **
 +
 +~~~bash
 +apt-get purge  '*netplan*'
 +systemctl disable --now systemd-networkd.service
 +~~~
 +
 +
 +~~~bash
 +chmod 600 /etc/netplan/00-network-manager.yaml
 +netplan try
 +netplan apply --debug
 +netplan apply
 +
 +nmcli connection add con-name vlan100 ifname enp7s0 type ethernet ip4 192.168.100.21/24
 +nmcli connection up vlan100
 +
 +hostnamectl hostname vmdeb01
 +
 +#echo -e "$(hostname -I | awk '{print $2}')\t\t$(hostname)" >> /etc/hosts
 +echo "192.168.100.21  vmdeb01.local vmdeb01" >> /etc/hosts
 +echo "192.168.100.22  vmdeb02.local vmdeb02" >> /etc/hosts
 +
 +apt-get install openssh-server
 +
 +adduser admin
 +
 +echo "admin ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/admin
 +~~~
 +
 +
 +~~~bash
 +# sysctl params required by setup, params persist across reboots
 +cat <<EOF | sudo tee /etc/sysctl.d/k8s.conf
 +net.ipv4.ip_forward = 1
 +EOF
 +
 +# Apply sysctl params without reboot
 +sudo sysctl --system
 +~~~
 +
 +Vérif
 +~~~bash
 +sysctl net.ipv4.ip_forward
 +~~~
 +
 +Source : https://kubernetes.io/docs/setup/production-environment/container-runtimes/#cgroup-drivers
 +
 +
 +
 +### Old - conf Docker
 +
 +
 +~~~bash
 +groupadd -g 500000 dockremap
 +groupadd -g 501000 dockremap-user
 +useradd -u 500000 -g dockremap -s /bin/false dockremap
 +useradd -u 501000 -g dockremap-user -s /bin/false dockremap-user
 +
 +echo "dockremap:500000:65536" >> /etc/subuid
 +echo "dockremap:500000:65536" >> /etc/subgid
 +~~~
 +
 +~~~
 +useradd is a low level utility for adding users. On Debian, administrators should usually use adduser(8) instead.
 +~~~
 +
 +`/etc/docker/daemon.json`
 +~~~json
 +{
 +  "userns-remap": "default"
 +}
 +~~~
 +
 +
 +
 +### Old
 +
 +
 +`/etc/docker/daemon.json`
 +~~~javascript
 +{
 +  "exec-opts": ["native.cgroupdriver=systemd"],
 +  "log-driver": "json-file",
 +  "log-opts": {
 +    "max-size": "100m"
 +  },
 +  "storage-driver": "overlay2"
 +}
 +~~~
 +
 +~~~bash
 +sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
 +sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
 +sudo update-alternatives --set arptables /usr/sbin/arptables-legacy
 +sudo update-alternatives --set ebtables /usr/sbin/ebtables-legacy
 +~~~
 +
 +
 +
 +~~~bash
 +systemctl restart docker.service
 +~~~
 +
 +
 +
 +
 +
 +
 +
  

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki