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.关机后创建快照

右键

点击 快照 -> 拍摄快照

起个名字

点击拍摄快照

相关推荐
方便面不加香菜4 小时前
Linux--基础IO(一)
linux·运维·服务器
张忠琳6 小时前
【client-go v0.36.1】(store Part 3)Store 超深度分析 — 集成模式、完整数据流、不变量、与 DeltaFIFO 协作
云原生·kubernetes·informer·store·client-go
mounter6259 小时前
现代 Linux 内存管理的演进与变革:从传统 LRU 到多代架构 MGLRU
linux·服务器·kernel
赵渝强老师9 小时前
【赵渝强老师】Kubernetes(K8s)中的金丝雀升级
linux·docker·云原生·容器·kubernetes
鹤落晴春9 小时前
【K8s】配置存储卷
云原生·容器·kubernetes
Qt程序员9 小时前
Linux RCU 原理与应用
linux·c++·内核·linux内核·rcu
The Sheep 202310 小时前
Vue复习
linux·服务器·数据库
兄台の请冷静10 小时前
Linux 安装es
linux·elasticsearch·jenkins
fengyehongWorld10 小时前
Linux rg命令
linux
pride.li10 小时前
海思视觉Hi3516CV610--开机自动设置ip
linux·网络·网络协议·tcp/ip