Ghi chép kubernetes

https://www.thebigdatablog.com/kubernetes-and-docker-running-at-an-orangepi/

https://blog.alexellis.io/test-drive-k3s-on-raspberry-pi/

https://github.com/rancher/k3s/issues/1395

MASTER NODE

  • Đổi tên hostname

    echo "masterpi" > /etc/hostname
    sudo nano /etc/hosts
    

Cài đặt

curl -sfL https://get.k3s.io | sh -
sudo systemctl status k3s

sudo cat /var/lib/rancher/k3s/server/node-token

K104a57a00c6ca0b2d1e558a79e6ae4c3d151474eccfc08677f501426f6ede66ef3::server:1c7e84a0f9f90def290c62d503038dba

NODE

export K3S_URL="https://:<MASTERPI-IP>:6443"

export K3S_TOKEN="K104a57a00c6ca0b2d1e558a79e6ae4c3d151474eccfc08677f501426f6ede66ef3::server:1c7e84a0f9f90def290c62d503038dba"
````

````
curl -sfL https://get.k3s.io | sh -
````


Join node 

sudo k3s agent –server ${K3S_URL} –token ${K3S_TOKEN}


DELETE NOT READY NODE



Cordon the node
Drain the node
Delete the node
Reset the node ( run kubeadm reset command if it is joined using kubeadm)
Join the node again as a fresh node

Sự cố

Build với không điểm yếu nên nếu có sự cố xảy ra cũng cho phép khắc phục nhanh

LINK.................

Run on Master

kubectl cordon

kubectl drain –delete-exit-data –force –ignore-daemonsets –delete-local-data

kubectl delete node


export KUBECONFIG=/etc/rancher/k3s/k3s.yaml


helm install metallb stable/metallb –namespace kube-system
–set configInline.address-pools[0].name=default
–set configInline.address-pools[0].protocol=layer2
–set configInline.address-pools[0].addresses[0]=10.0.0.10-10.0.0.20 ```