RockyLinux 为 k8s 集群做准备

1.准备VM

镜像

开启虚拟机

选择安装 Rocky linux 9.5

软件选择最小安装就可以了

在 rocky 9 以后版本中 他全部 采用 network manager 去替换老的 network 去实现网络的管理

1.网卡配置

bash 复制代码
cat /etc/NetworkManager/system-connections/ens160.nmconnection

我们配置了两块网卡

选择第一块配置

method=auto 自动 改成 手动 manual

address1 逗号后面哪个 是网关 我们没有 所以先不用设置

bash 复制代码
[ipv4]
method=manual
address1=192.168.72.11/24
dns=114.114.114.114;8.8.8.8;8.8.8.4

address1 地址要和 下面地址一样网段 后面可以随便写

保存退出 重启网卡

bash 复制代码
systemctl restart NetworkManager

2.替换系统镜像源

不要弄 我有代理 不需要 弄了反而访问不通

3.防火墙关闭

bash 复制代码
systemctl stop firewalld
bash 复制代码
systemctl disable firewalld

4.安装 iptables

bash 复制代码
yum -y install iptables-services

开启我们的 iptables 的用户态

bash 复制代码
systemctl start iptables

默认规则

但是我们不需要

清空规则

bash 复制代码
iptables -F

将空规则保存到持久化文件里

bash 复制代码
service iptables save

开机自启

bash 复制代码
systemctl enable iptables

5.禁用 selinux

bash 复制代码
setenforce 0
bash 复制代码
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
bash 复制代码
grubby --update-kernel ALL --args selinux=0

查看是否禁用 可以不执行

bash 复制代码
grubby --info DEFAULT

回滚内核层禁用操作 可以不执行

bash 复制代码
grubby --update-kernel ALL --remove-args selinux

我没执行

6.设置时区

bash 复制代码
timedatectl set-timezone Asia/Shanghai

先关闭当前机器 因为 这个系统我们会复用很多次

bash 复制代码
shutdown -h now

7.关机后创建快照

右键

点击 快照 -> 拍摄快照

起个名字

点击拍摄快照

相关推荐
lichenyang4531 小时前
Docker 学习笔记(四):Dockerfile,把项目打成自己的镜像
docker·容器
lichenyang4531 小时前
Docker 学习笔记(三):Docker 网络、bridge、子网和容器互通
docker·容器
lichenyang4532 小时前
Docker 学习笔记(二):docker run 的参数到底在控制什么?
docker·容器
XIAOHEZIcode2 小时前
Ubuntu 终端美化全栈指南:Bash 到 Kitty 踩坑实录
linux·ubuntu·命令行
唐青枫4 小时前
别再只会用 cron:Linux systemd Timer 定时任务实战详解
linux
AlfredZhao2 天前
生产环境里,为什么不建议把普通端口直接暴露到公网?
linux·https·443·80
运维开发故事3 天前
基于 Arthas 的多集群在线诊断系统设计与实现
kubernetes
戴为沐3 天前
Linux内存扩容指南
linux
zylyehuo4 天前
Linux 彻底且安全地删除文件
linux
用户805533698034 天前
主线 U-Boot 上 RK3506:和闭源 rkbin 拔河的三个隐性契约
linux·嵌入式