惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
A
About on SuperTechFans
IT之家
IT之家
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Blog — PlanetScale
Blog — PlanetScale
aimingoo的专栏
aimingoo的专栏
云风的 BLOG
云风的 BLOG
The GitHub Blog
The GitHub Blog
Vercel News
Vercel News
G
Google Developers Blog
J
Java Code Geeks
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
Cloudbric
Cloudbric
L
LINUX DO - 最新话题
MyScale Blog
MyScale Blog
H
Heimdal Security Blog
PCI Perspectives
PCI Perspectives
Attack and Defense Labs
Attack and Defense Labs
S
Security @ Cisco Blogs
Latest news
Latest news
I
Intezer
L
Lohrmann on Cybersecurity
C
CXSECURITY Database RSS Feed - CXSecurity.com
月光博客
月光博客
T
Threatpost
博客园 - 【当耐特】
S
Schneier on Security
P
Privacy International News Feed
G
GRAHAM CLULEY
T
Tenable Blog
AWS News Blog
AWS News Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
雷峰网
雷峰网
博客园 - Franky
Engineering at Meta
Engineering at Meta
美团技术团队
S
Secure Thoughts
T
Troy Hunt's Blog
Microsoft Security Blog
Microsoft Security Blog
SecWiki News
SecWiki News
V
Visual Studio Blog
人人都是产品经理
人人都是产品经理
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Cisco Talos Blog
Cisco Talos Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Martin Fowler
Martin Fowler
Webroot Blog
Webroot Blog
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More

博客园 - 尹正杰

k8s集群为每个节点分配不通的ippool实战 ansible剧本实现一键升级K8S集群的NVIDIA GPU驱动 vmagent采集etcd数据并写入victoriametrics集群 VictoriaMetrics集群部署实战 Squid正向代理实战 filebeat指定名称空间采集pod数据 Calico自定义Ipool实战 ansible剧本实现kibana的部署和卸载 ansible剧本应用案例集合2 ansible剧本实现磁盘格式化 Ansible急速入门实战篇 ansible快速入门篇 k8s集群管理 kubesray实战 kubespray实战案例 kubespray管理k8s的worker集群扩缩容 kubespray快速部署k8s集群实战 Kubeasz使用吐槽博客专题 Kubeasz基于ezctl实现etcd集群的管理实战 Kubeasz基于ezctl实现k8s集群一键升级 Calico启用纯BGP模式+RR实战案例 Calico 底层原理及IPIP(依赖BGP协议))和vxlan(不依赖BGP)工作模式切换 kubeasz基于ezctl实现k8s集群的扩容和缩容 kubeasz快速部署K8S集群实战 Ubuntu 24.04.04 LTS版本系统优化 Ubuntu Server 24.04.04 LTS部署指南 windows极速部署Openclaw实战篇 K8S的StatefulSet控制器应用案例之MySQL主从同步实战 k8s底层基于不同运行时集成harbor企业级私有仓库实战 二进制K8S集群附加组件部署及CNI网络插件切换实战 二进制部署K8S 1.35.0+最新版实战案例 etcd高可用集群部署及K8S周期性备份数据实战 基于Docker实现《若依》服务业务容器化实战篇 k8s集群基于Flannel网络插件部署凡人修仙传 k8s集群基于Calico网络插件部署凡人修仙传 ElasticSEearch 9.X环境部署 K8S Vertical Pod Autoscaler(VPA)实战案例 Prometheus监控自定义程序指标
kubespray生产故障案例之kubelet启动参数案例
尹正杰 · 2026-06-28 · via 博客园 - 尹正杰

                                              作者:尹正杰

版权声明:原创作品,谢绝转载!否则将追究法律责任。

一.故障背景

1.开发需求,需要修改kubelet的启动参数如下:

image

image

开发给定的相关参数:
		--cpu-manager-policy=static、--topology-manager-policy=best-effort
	
	相关参数说明:
		--cpu-manager-policy=static:
			CPU管理器策略:static 开启CPU绑定
		
		
		--topology-manager-policy=best-effort
			拓扑管理器策略:best-effort 尽力亲和
		
官方文档的参数说明:
    https://kubernetes.io/zh-cn/docs/reference/command-line-tools-reference/kubelet/


如上图所示,开发给我两个参数K8S官方都已经弃用,目前版本可能还是要用的,未来版本就必须基于配置文件的方式指定方能失效哟,我的生产环境是k8s 1.33.10版本,你得看你的自己的版本是啥。

2.kubespray修改kubelet参数修改,配置要做特定格式的修改

(venv) [root@ansible99 kubespray]# vim inventory/yinzhengjie-k8s/group_vars/k8s_cluster/k8s-cluster.yml 
...
kubelet_topology_manager_policy: best-effort
kubelet_cpu_manager_policy: static

3.运行任务生效时报错

(venv) [root@ansible99 kubespray]# time ansible-playbook -i inventory/yinzhengjie-k8s/inventory.ini cluster.yml --tags kubelet -v
...
TASK [kubernetes/node : Install | Copy kubeadm binary from download dir] ***************************************************************************************************
fatal: [worker77]: FAILED! => {"changed": false, "msg": "Source /tmp/releases/kubeadm-1.33.10-amd64 not found"}
fatal: [worker66]: FAILED! => {"changed": false, "msg": "Source /tmp/releases/kubeadm-1.33.10-amd64 not found"}

PLAY RECAP *****************************************************************************************************************************************************************
master231                  : ok=28   changed=1    unreachable=0    failed=0    skipped=22   rescued=0    ignored=0   
master232                  : ok=16   changed=1    unreachable=0    failed=0    skipped=16   rescued=0    ignored=0   
master233                  : ok=16   changed=1    unreachable=0    failed=0    skipped=16   rescued=0    ignored=0   
worker66                   : ok=17   changed=1    unreachable=0    failed=1    skipped=15   rescued=0    ignored=0   
worker77                   : ok=17   changed=1    unreachable=0    failed=1    skipped=15   rescued=0    ignored=0   

Sunday 28 June 2026  21:26:52 +0800 (0:00:02.128)       0:02:16.609 *********** 
=============================================================================== 
kubernetes/preinstall : Create kubernetes directories -------------------------------------------------------------------------------------------------------------- 26.69s
network_facts : Gather node IPs ------------------------------------------------------------------------------------------------------------------------------------ 24.45s
Gathering Facts ---------------------------------------------------------------------------------------------------------------------------------------------------- 16.60s
Gather minimal facts ----------------------------------------------------------------------------------------------------------------------------------------------- 16.55s
Gather necessary facts (network) ----------------------------------------------------------------------------------------------------------------------------------- 16.34s
kubernetes/preinstall : Create other directories of root owner ----------------------------------------------------------------------------------------------------- 11.75s
Gather necessary facts (hardware) ---------------------------------------------------------------------------------------------------------------------------------- 11.59s
kubernetes/node : Install | Copy kubeadm binary from download dir --------------------------------------------------------------------------------------------------- 2.13s
adduser : User | Create User ---------------------------------------------------------------------------------------------------------------------------------------- 1.29s
adduser : User | Create User Group ---------------------------------------------------------------------------------------------------------------------------------- 1.05s
dynamic_groups : Match needed groups by their old names or definition ----------------------------------------------------------------------------------------------- 0.78s
network_facts : Set computed IPs variables -------------------------------------------------------------------------------------------------------------------------- 0.65s
validate_inventory : Stop if unsupported version of Kubernetes ------------------------------------------------------------------------------------------------------ 0.47s
kubernetes/node : Os specific vars ---------------------------------------------------------------------------------------------------------------------------------- 0.36s
validate_inventory : Stop if removed tags are used ------------------------------------------------------------------------------------------------------------------ 0.34s
validate_inventory : Stop if auto_renew_certificates is enabled when certificates are managed externally (kube_external_ca_mode is true) ---------------------------- 0.32s
kubernetes/node : Set kubelet_config_extra_args options when cgroupfs is used --------------------------------------------------------------------------------------- 0.30s
kubernetes/node : Set kubelet_cgroup_driver_detected fact for containerd -------------------------------------------------------------------------------------------- 0.30s
kubernetes/node : Set kubelet_cgroups options when cgroupfs is used ------------------------------------------------------------------------------------------------- 0.30s
validate_inventory : Check cloud_provider value --------------------------------------------------------------------------------------------------------------------- 0.26s
(venv) [root@ansible99 kubespray]#

二.解决故障

1.下载并分发二进制软件包到各个节点

故障分析:
	上面的报错关键点是"Source /tmp/releases/kubeadm-1.33.10-amd64 not found",说白了就是找不到文件。
	

先下载并分发二进制软件包到各个节点
(venv) [root@ansible99 kubespray]# time ansible-playbook -i inventory/yinzhengjie-k8s/inventory.ini cluster.yml --tags download,binaries -v
...
real	8m9.553s
user	3m46.245s
sys	1m29.645s
(venv) [root@ansible99 kubespray]# 
(venv) [root@ansible99 kubespray]# 

2.重新部署服务

(venv) [root@ansible99 kubespray]# time ansible-playbook -i inventory/yinzhengjie-k8s/inventory.ini cluster.yml --tags kubelet -v
...
real	2m49.481s
user	0m44.540s
sys	0m13.649s
(venv) [root@ansible99 kubespray]# 

3.测试验证kubelet参数是否修改成功

[root@worker66 ~]# grep Policy  /etc/kubernetes/kubelet-config.yaml 
cpuManagerPolicy: static
topologyManagerPolicy: best-effort
[root@worker66 ~]#