{{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 <> /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 ~~~