Skip to content

Instantly share code, notes, and snippets.

@baoduy
Created October 6, 2022 02:05
Show Gist options
  • Save baoduy/62ec6da089a3c0a6f950c39744adb6c4 to your computer and use it in GitHub Desktop.
Save baoduy/62ec6da089a3c0a6f950c39744adb6c4 to your computer and use it in GitHub Desktop.
K3s installation
K3s installation
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--disable=traefik@server:0 --tls-san=121.6.45.41 --cluster-cidr=10.10.0.0/16" sh -
sudo cat /etc/rancher/k3s/k3s.yaml
Update DNS Name Server
first install resolvconf if not installed
sudo apt update
sudo apt install resolvconf
check resolvconf service started and enabled
sudo systemctl status resolvconf.service
if service is not enabled you can start and enable it with :
sudo systemctl start resolvconf.service
sudo systemctl enable resolvconf.service
now edit resolv.conf.d/head configuration file
sudo nano /etc/resolvconf/resolv.conf.d/head
add your DNS addresses to this file for example I use (8.8.8.8 and 8.8.4.4)
nameserver 8.8.8.8
nameserver 8.8.4.4
now force resolvconf to run update scripts when invoked with -u
sudo resolvconf --enable-updates
now run updates
sudo resolvconf -u
now if you check cat /etc/resolv.conf you must see your DNS configuration in this file if not try these commands and check again
sudo systemctl restart resolvconf.service
sudo systemctl restart systemd-resolved.service
Disable IP6
sudo nano /etc/sysctl.conf
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
sudo sysctl -p
sudo iptables -F
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
sudo reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment