有奖捉虫:行业应用 & 管理与支持文档专题 HOT

功能概览

Management 参数为节点常用自定义配置提供了统一的入口,您可通过该入口为原生节点底层的内核参数 KernelArgs 进行调优,同时支持设置 Kubelet\\Nameservers\\Hosts 来满足业务部署的环境要求。

Management 参数项

参数项
描述
KubeletArgs
设置业务部署时需要自定义的 Kubelet 相关参数。
Nameservers
设置业务部署环境需要 DNS 服务器地址。
Hosts
设置业务部署环境所需要的 Hosts。
设置内核参数对业务进行性能调优(该功能目前白名单开放,可 提交工单 申请)。
说明
1. 已放开自定义配置的 Kubelet 参数和集群版本相关,若当前集群在控制台可选的 Kubelet 参数无法满足您的需求,请 提交工单 支持。
2. 为确保系统组件正常安装,原生节点默认注入腾讯云官方资料库地址 nameserver = 183.60.83.19nameserver = 183.60.82.98

通过控制台操作

方式1:为新增节点池设置 Management 参数

1. 登录 容器服务控制台,参考 新建原生节点 文档创建原生节点。
2. 新建页面,单击高级设置,为节点设置 Management 参数。如下图所示:
?
?
?
3. 单击创建节点池

方式2:为已有节点池设置 Management 参数

1. 登录 容器服务控制台,选择左侧导航栏中的集群
2. 在集群列表页中,单击集群 ID,进入该集群详情页。
3. 选择左侧菜单栏中的节点管理 > Worker 节点,在节点池中单击节点池 ID,进入节点池详情页。
4. 在节点池详情页中,单击参数设置 > Management > 编辑,修改 Management 参数。如下图所示:
?
?
?
5. 您可通过勾选“存量更新”来设置本次参数修改是否针对节点池中的存量节点生效,勾选后本次对 Management 的更改(包括删除、更新、追加)会对节点池内全量节点(包括存量和增量)生效。如下图所示:
?
?
?
更新步长:系统将分批执行运维参数更新操作,该参数定义每批次可同时执行更新的节点数。
最大不可用配置数:更新失败(包含更新中)的节点超过该设定值时,系统将暂停更新操作。
6. 单击确定。您可在节点池的“运维记录”中查看更新进展和结果。
警告:
某些 Kubelet 参数对存量节点生效时会触发业务 Pod 重启,例如 “feature-gates: EnableInPlacePodResize=true”、“kube-reserved: xxx”、“eviction-hard: xxx”、“max-pods: xxx”,建议评估风险后谨慎操作。

通过 YAML 操作

apiVersion: node.tke.cloud.tencent.com/v1beta1
kind: MachineSet
spec:
autoRepair: false
deletePolicy: Random
displayName: xxxxxx
healthCheckPolicyName: ""
instanceTypes:
- SA2.2XLARGE8
replicas: 2
scaling:
createPolicy: ZoneEquality
subnetIDs:
- subnet-xxxxx
- subnet-xxxxx
template:
spec:
displayName: tke-np-bqclpywh-worker
providerSpec:
type: Native
value:
instanceChargeType: PostpaidByHour
keyIDs:
- skey-xxxxx
lifecycle: {}
management:
kubeletArgs:
- feature-gates=EnableInPlacePodResize=true
- allowed-unsafe-sysctls=net.core.somaxconn
- root-dir=/var/lib/test
- registry-qps=1000
hosts:
- Hostnames:
- static.fake.com
IP: 192.168.2.42
nameservers:
- 183.60.83.19
- 183.60.82.98
kernelArgs:
- kernel.pid_max=65535
- fs.file-max=400000
- net.ipv4.tcp_rmem="4096 12582912 16777216"
- vm.max_map_count="65535"
metadata:
creationTimestamp: null
securityGroupIDs:
- sg-b3a93lhv
systemDisk:
diskSize: 50
diskType: CloudPremium
runtimeRootDir: /var/lib/containerd
type: Native
?

KubeletArgs 参数说明

1. 不同账户、不同集群版本下支持配置的 kubelet 参数不完全一致,若当前参数不满足您的需求,您可以通过 在线客服提交工单 与我们联系。
2. 以下参数不推荐修改,否则很大概率会影响节点上的业务正常运行:
container-runtime
container-runtime-endpoint
hostname-override
kubeconfig
root-dir

KernelArgs 参数说明

下面列出了支持调整的 OS 参数和接受的值。

套接字和网络优化

对于预期会处理大量并发会话的代理节点,您可以使用下面的 TCP 和网络选项调整。
编号
参数
默认值
允许的值 / 范围
参数类型
范围
1
"net.core.somaxconn"
32768
4096 - 3240000
int
The maximum length of the listening queue for each port in the system.
2
"net.ipv4.tcp_max_syn_backlog"
8096
1000 - 3240000
int
The maximum length of tcp SYN queue length.
3
"net.core.rps_sock_flow_entries"
8192
1024 - 536870912
int
The maximum size of hash table for RPS.
4
"net.core.rmem_max"
16777216
212992 - 134217728
int
The maximum size, in bytes, of the receive socket buffer.
5
"net.core.wmem_max"
16777216
212992 - 134217728
int
The maximum size, in bytes, of the send socket buffer.
6
"net.ipv4.tcp_rmem"
"4096 12582912 16777216"
1024 - 2147483647
string
The min/default/max size of tcp socket receive buffer.
7
"net.ipv4.tcp_wmem"
"4096 12582912 16777216"
1024 - 2147483647
string
The min/default/max size of tcp socket send buffer.
8
"net.ipv4.neigh.default.gc_thresh1"
2048
128 - 80000
int
The minimum number of entries that can be retained. If the number of entries is less than this value, the entries will not be recycled.
9
"net.ipv4.neigh.default.gc_thresh2"
4096
512 - 90000
int
When the number of entries exceeds this value, the GC will clear the entries longer than 5 seconds.
10
"net.ipv4.neigh.default.gc_thresh3"
8192
1024 - 100000
int
Maximum allowable number of non-permanent entries.
11
"net.ipv4.tcp_max_orphans"
32768
4096 - 2147483647
int
Maximal number of TCP sockets not attached to any user file handle, held by system. Increase this parameter properly to avoid the 'Out of socket memory' error when the load is high.
12
"net.ipv4.tcp_max_tw_buckets"
32768
4096 - 2147483647
int
Maximal number of timewait sockets held by system simultaneously. Increase this parameter properly to avoid ‘TCP: time wait bucket table overflow’ error.

文件句柄限制

在为大量流量提供服务时,所服务的流量通常来自大量本地文件。 您可以略微调整以下内核设置和内置限制,以便只占用部分系统内存来处理更大的量。
编号
参数
默认值
允许的值 / 范围
参数类型
范围
1
"fs.file-max"
3237991
8192 - 12000500
int
Limit on the total number of fd, including socket, in the entire system.
2
"fs.inotify.max_user_instances"
8192
1024 - 2147483647
int
Limit on the total number of inotify instances.
3
"fs.inotify.max_user_watches"
524288
781250 - 2097152
int
The total number of inotify watches is limited. Increase this parameter to avoid ‘Too many open files’ errors.

虚拟内存

以下设置可用于调整 Linux 内核虚拟内存 (VM) 子系统的操作以及向磁盘进行脏数据的 writeout。
编号
参数
默认值
允许的值 / 范围
参数类型
范围
1
"vm.max_map_count"
262144
65530 - 262144
int
The maximum number of memory map areas a process may have.

工作线程限制

编号
参数
默认值
允许的值 / 范围
参数类型
范围
1
"kernel.threads-max"
4194304
4096 - 4194304
int
The system-wide limit on the number of threads (tasks) that can be created on the system.
2
"kernel.pid_max"
4194304
4096 - 4194304
int
PIDs greater than this value are not allocated; thus, the value in this file also acts as a system-wide limit on the total number of processes and threads.
?


http://www.vxiaotou.com