使用 Ubuntu 来安装 Kubernetes 1.24 版本

1. 机器初始化设置

hostname 设置

1
2
hostnamectl ## 查看当前的hostname
hostnamectl set-hostname node1 ## 设置主机名为node1

/etc/hosts 文件 和 DNS 配置

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# k8s master
192.168.130.131 node1 

# 更改dns配置
vim /etc/systemd/resolved.conf 
# 更改下面内容
[Resolve]
DNS=8.8.8.8 8.8.4.4
# 重启dns
systemctl restart systemd-resolved.service

refer:

在 Docker 上安装 Nfs

install nfs in docker

1. create share directory used by nfs

1
mkdir -p /home/ooooo/shared/nfs

2. create exports.txt used by nfs

This the exports.txt mainly used to mount dir (path in the container ) and permission.