文章目录
Ubuntu 22.04.5 + kubeadm:Kubernetes v1.28.2集群部署企业实战
一、环境准备
1.1 机器规划
三台机器都是采用Ubuntu 22.04.5的版本,内核版本是5.15.0-125-generic,三台机器具体的分布如下:
| 角色 | 主机名称 | IP | kueernetes版本 |
|---|---|---|---|
| master | k8s-master | 192.168.1.131 | v1.28.2 |
| node1 | k8s-node1 | 192.168.1.132 | v1.28.2 |
| node2 | k8s-node2 | 192.168.1.133 | v1.28.2 |
Docker Engine 没有实现 CRI, 而这是容器运行时在 Kubernetes 中工作所需要的。 为此,必须安装一个额外的服务 cri-dockerd。 cri-dockerd 是一个基于传统的内置 Docker 引擎支持的项目,它在 1.24 版本从 kubelet 中移除。
1.2 环境配置
**注意:**没明确标记的,各个节点分别执行。
确保每个节点上的MAC地址和product_uuid的唯一性。
- 你可以使用命令
ip link或ifconfig -a来获取网络接口的 MAC 地址
$ ip link
$ ifconfig -a
- k8s-master
superman@k8s-1:~$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
link/ether 00:0c:29:1b:04:d1 brd ff:ff:ff:ff:ff:ff
altname enp2s1
superman@k8s-1:~$
superman@k8s-1:~$ ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.131 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::20c:29ff:fe1b:4d1 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:1b:04:d1 txqueuelen 1000 (Ethernet)
RX packets 12685 bytes 17472224 (17.4 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2530 bytes 328873 (328.8 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 216 bytes 20866 (20.8 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 216 bytes 20866 (20.8 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
superman@k8s-1:~$
- k8s-node1
superman@k8s-2:~$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
link/ether 00:0c:29:22:09:61 brd ff:ff:ff:ff:ff:ff
altname enp2s1
superman@k8s-2:~$
superman@k8s-2:~$ ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.132 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::20c:29ff:fe22:961 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:22:09:61 txqueuelen 1000 (Ethernet)
RX packets 1214 bytes 264472 (264.4 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 789 bytes 171947 (171.9 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 114 bytes 9286 (9.2 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 114 bytes 9286 (9.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
superman@k8s-2:~$
- k8s-node2
superman@k8s-3:~$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdi


2784

被折叠的 条评论
为什么被折叠?



