Skip to content

Commit

Permalink
更新内容
Browse files Browse the repository at this point in the history
  • Loading branch information
isno committed Jan 1, 2024
1 parent 851d6c0 commit f8e509e
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
30 changes: 28 additions & 2 deletions container/k8s-deploy-prepare.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,36 @@
# 初始化准备


关闭 swap
1. 关闭 swap 内存

```
# 使用命令直接关闭swap内存
swapoff -a
# 修改fstab文件禁止开机自动挂载swap分区
sed -i '/swap / s/^\(.*\)$/#\1/g' /etc/fstab
```

内存不足时,Linux 会自动使用 swap,将部分内存数据存放到磁盘中,运维实际的观察的情况是当内存不够发生内存转储到 swap 的时候,系统的任务负载数字会飙升,而且会持续很长时间,整个系统出现僵死情况,与其整个节点挂掉,不如 OOM 的时候直接杀掉进程。
内存不足时,Linux 会自动使用 swap,将部分内存数据存放到磁盘中,运维实际的观察的情况是当内存不够发生内存转储到 swap 的时候,系统的任务负载数字会飙升,而且会持续很长时间,整个系统出现僵死情况,与其整个节点挂掉,不如 OOM 的时候直接杀掉进程。

2. 关闭selinux

```
# 使用命令直接关闭
setenforce 0
# 也可以直接修改/etc/selinux/config文件
sed -i 's/^SELINUX=enforcing$/SELINUX=disabled/' /etc/selinux/config
```

3. 配置防火墙

```
# 使用systemctl禁用默认的firewalld服务
systemctl disable firewalld.service
```

4. 配置netfilter参数

```
```
5 changes: 4 additions & 1 deletion container/k8s-deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@

## 集群信息

- 内核版本:5.15.145-1.el7.x86_64
- 系统内核版本:5.15.145-1.el7.x86_64
- Kubernetes 版本 1.29(2023.11.16)
- 容器运行时 containerd 1.7.11()
- 网络 clilium 1.14(VXLAN 模式)


## API Server 高可用负载均衡
Expand Down

0 comments on commit f8e509e

Please sign in to comment.