Chinese Yellow Pages | Classifieds | Knowledge | Tax | IME

HW

Purpose:

Add old laptop  to existing k8s

HW:

Add Laptop with only Wifi ( no ethernet port)

Software debian 12

(1) k8s

apt-get install bridge-utils

apt-get install nfs-common

sudo mkdir -m 755 /etc/apt/keyrings

sudo apt-get update
# apt-transport-https may be a dummy package; if so, you can skip that package
sudo apt-get install -y apt-transport-https ca-certificates curl
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.27/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
# This overwrites any existing configuration in /etc/apt/sources.list.d/kubernetes.list
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.27/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install -y kubelet kubeadm kubectl
sudo apt-mark hold kubelet kubeadm kubectl

(2) docker

sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

(3) some configs

scp 192.168.86.30:/etc/containerd/config.toml .

scp -r 192.168.86.30:/etc/containerd/certs.d .

sudo systemctl restart containerd

(4) join k8s

sudo swapoff -a

# enable forward

sysctl net.bridge.bridge-nf-call-iptables net.bridge.bridge-nf-call-ip6tables net.ipv4.ip_forward

# show the join command/token in master node

kubeadm token create --print-join-command

#join at worker node

kubeadm join 192.168.86.30:6443 –token 6edyvs.xx –discovery-token-ca-cert-hash sha256:1xx

 

(5) disable power off on close lid on laptop, reboot laptop

https://wiki.debian.org/Suspend#Disable_suspend_and_hibernation

[Sleep]
AllowSuspend=no
AllowHibernation=no
AllowSuspendThenHibernate=no
AllowHybridSleep=no

systemctl restart systemd-logind.service

this is need to login user/session on the box

/etc/systemd/logind.conf

HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore

systemctl restart systemd-logind.service

Leave a Reply

Your email address will not be published. Required fields are marked *