当前位置:网站首页>Troubleshooting the kubernetes problem: deleting the rancher's namespace by mistake causes the node to be emptied
Troubleshooting the kubernetes problem: deleting the rancher's namespace by mistake causes the node to be emptied
2022-06-24 13:24:00 【imroc】
This article excerpts from kubernetes Learning notes
Problem description
The nodes of the cluster suddenly disappeared (kubectl get node It's empty ), Cause cluster paralysis , But in fact, the virtual machines corresponding to the nodes are still . Because the cluster did not open the audit , So it's not easy to check node What was deleted .
Fast recovery
Because only k8s node Resource deleted , The actual machines are still there , We can restart nodes in batches , Automatic pull up kubelet Re registration node, Can be restored .
Suspicious operation
Found before the node disappeared , There is a suspicious operation : Some students found that in another cluster, there were a lot of messy namespace ( such as c-dxkxf), View these namespace No workload is running in , It could be a test created by someone else namespace, Just delete it .
analysis
Delete namespace Is installed in the cluster of rancher, Suspected of being deleted namespace yes rancher Automatically created .
rancher Managed other k8s colony , Architecture diagram :
guess : Delete the namespace yes rancher Created , Cleaned up when deleting rancher Resources for , It also triggers rancher clear node The logic of .
Analog reproduction
Try to simulate a recurrence , Verify the conjecture :
- Create a k8s colony , As rancher Of root cluster, And will rancher Install in .
- Get into rancher web Interface , Create a cluster, Use import The way :
- Output cluster name:
- Pop up the prompt , Let the following... Be executed in another cluster kubectl Command to import it into rancher:
- Create another k8s Cluster as rancher Managed clusters , And will kubeconfig Import local for later use kubectl operation .
- Import kubeconfig And switch context after , perform rancher Provided kubectl Command to import the cluster into rancher:
You can see in the managed TKE Automatically created in the cluster cattle-system Namespace , And run some rancher Of agent:
- take context Switch to installation rancher The cluster of (root cluster), You can find that after adding a cluster , Automatically created some namespace: 1 individual
c-At the beginning ,2 individual-pAt the beginning :
Guess it is c- At the beginning namespace By rancher Used to store the added cluster Information about ;-p Used to store project Relevant information , The official also said that it would be automatically for each cluster establish 2 individual project:
- See what rancher Of crd, There is one
nodes.management.cattle.ioQuite conspicuous , Obviously used to store cluster Of node Information :
- look down node Where to store it namespace ( As expected
c-At the beginning namespace in ):
- Try to delete
c-At the beginning namesapce, And switch context To the added cluster , performkubectl get node:
Nodes are cleared , Problem recurrence .
Conclusion
Experimental proof ,rancher Of c- At the beginning namespace Saved the... Of the added cluster node Information , If you delete this namespace, That is, the stored node Information ,rancher watch The associated cluster will be deleted automatically k8s node resources .
therefore , Never clean up easily rancher Created namespace,rancher Some stateful information is stored directly in root cluster in ( adopt CRD resources ), Delete namespace May cause very serious consequences .
边栏推荐
- [day ui] affix component learning
- Interviewer: the MySQL database is slow to query. What are the possible reasons besides the index problem?
- Cmput 379 explanation
- 天猫618农产品“百强县” 35个县域来自中西部及东北
- Ask a question about SQL view
- 问个sql view的问题
- Beauty of script │ VBS introduction interactive practice
- Cohere、OpenAI、AI21联合发布部署模型的最佳实践准则
- Concept + formula (excluding parameter estimation)
- CVPR 2022 - Interpretation of selected papers of meituan technical team
猜你喜欢

Opengauss kernel: simple query execution

不用Home Assistant,智汀也开源接入HomeKit、绿米设备?

Brief introduction to cluster analysis

使用 Abp.Zero 搭建第三方登录模块(一):原理篇

nifi从入门到实战(保姆级教程)——环境篇

Pycharm中使用Terminal激活conda服务(终极方法,铁定可以)

Without home assistant, zhiting can also open source access homekit and green rice devices?

Parti,谷歌的自回归文生图模型

go Cobra命令行工具入门

Comparator sort functional interface
随机推荐
我从根上解决了微信占用手机内存问题
Resolve symbol conflicts for dynamic libraries
How can ffmpeg streaming to the server save video as a file through easydss video platform?
Use terminal to activate CONDA service in pypharm (the ultimate method is definitely OK)
DTU上报的数据值无法通过腾讯云规则引擎填入腾讯云数据库中
Who is the fish and who is the bait? Summary of honeypot recognition methods from the perspective of red team
openGauss内核:简单查询的执行
Implement Domain Driven Design - use ABP framework - update operational entities
Baidu simian: talk about persistence mechanism and rdb/aof application scenario analysis!
Beauty of script │ VBS introduction interactive practice
[log service CLS] Tencent cloud log service CLS accesses CDN
The difference between apt and apt get
Detailed explanation of abstractqueuedsynchronizer, the cornerstone of thread synchronization
Yolov6: the fast and accurate target detection framework is open source
不用Home Assistant,智汀也开源接入HomeKit、绿米设备?
线程同步的基石AbstractQueuedSynchronizer详解
Ask a question about SQL view
The 35 "top 100 counties" of tmall 618 agricultural products come from the central and western regions and Northeast China
Preparation and operation & Maintenance Guide for 'high concurrency & high performance & high availability service program'
我真傻,招了一堆只会“谷歌”的程序员!