当前位置:网站首页>Kubernets pod exists finalizers are always in terminating state
Kubernets pod exists finalizers are always in terminating state
2022-07-04 14:48:00 【Zhang quandan, Foxconn quality inspector】
Metadata
Defines the original data of the object ,namespace Is used to place objects , Objects can pass through namespace Isolation .
Any kubernetes The objects of are divided into two categories , A class of objects like nodes , A computing node belongs to the entire cluster , Such objects are nonnamespace, its namespace The value is always empty .
The other is pod,service, All belong to a tenant / User , These objects belong to namespace.
An object namespace+name It represents the unique value in the whole cluster .
typemeta Defines what I am ,metadata Defines who I am .
Finalizer
If you only contact the community kubernetes, So right. Finalizer There may not be too many concepts ,Finalizer Itself is a resource lock .
An object , When we created it , Send the request for this object to apiserver,apiserver After authentication, it is stored in etcd, If you delete this object , It also goes through the same link , It finally came from etcd Delete , The deletion itself is a physical deletion , amount to etcd This data is erased , The object disappears .
If the controller is written to monitor this object , Then it will listen to the creation of this object , Once this object is created, it will do something , When the object is deleted, it will do other things , We can't believe that the system is always working , Suppose the controller is wrong , Or the controller is being upgraded , The controller is not working at this time , Delete the object at this time , Suppose the object disappears , So this event has disappeared , After this object is deleted , Then start my controller , The controller cannot see the event that this object was deleted before , Because this event has already occurred before the controller is started , When starting a new controller instance , There is no notification of this message , Therefore, the event of object deletion is lost .
therefore fanalizer It is essentially a resource lock , An object is added finalizer, Physical deletion will not be performed when deleting objects , It will do logical deletion , In fact, it is in the event stamp of its attribute deletetimestamp Set to delete the timestamp at that moment .
The advantage is that when the user deletes an object , If the object has finalizer, Then this object will not disappear , The controller can then capture the event , Even when the controller is under maintenance , Then you can see this event after restarting , When an object is found deletetimestamp Not empty , Indicates that the user wants to delete it , Then some logic processing can be done in the controller .
When we allocate external resources , For example, create a pod, This pod After creation , We need to configure some external networks , Or configure external dns, External load balancing , At this time, you need to add finalizer, Then I need to write a controller , The controller is configured externally dns, Configure external dns We have to add finalizer, I configured the controller to add , Plus finalizer Then the object is locked , As long as it has finalizer Will not be physically deleted , When I delete this object , The controller will see update Events , See this object deletetimestamp Not empty , So this controller To clear the external configuration , When the external configuration is cleared , So by the controler take finalizer Delete the , After removal ,k8s Find this object finalizer It's empty , Then it will automatically change from logical deletion to physical deletion , The object disappears .
therefore finalizer It's a resource lock .
Pod Always in Terminating state There is Finalizers
边栏推荐
- Redis daily notes
- Wt588f02b-8s (c006_03) single chip voice IC scheme enables smart doorbell design to reduce cost and increase efficiency
- PLC模拟量输入 模拟量转换FC S_ITR (CODESYS平台)
- AI and Life Sciences
- Codeforce:c. sum of substrings
- Digi restarts XBee Pro S2C production. Some differences need to be noted
- SqlServer函数,存储过程的创建和使用
- Leetcode 61: rotating linked list
- LVGL 8.2 keyboard
- Explain of SQL optimization
猜你喜欢
Transplant tinyplay for imx6q development board QT system
Summary of common problems in development
leetcode:6110. 网格图中递增路径的数目【dfs + cache】
LVGL 8.2 text shadow
Data Lake (13): spark and iceberg integrate DDL operations
Kubernets Pod 存在 Finalizers 一直处于 Terminating 状态
leetcode:6109. Number of people who know the secret [definition of DP]
【MySQL从入门到精通】【高级篇】(四)MySQL权限管理与控制
Leetcode 1200 minimum absolute difference [sort] The Path of leetcode for heroding
codeforce:C. Sum of Substrings【边界处理 + 贡献思维 + 灵光一现】
随机推荐
關於miui12.5 紅米k20pro用au或者povo2出現問題的解决辦法
First experience of ViewModel
UFO:微软学者提出视觉语言表征学习的统一Transformer,在多个多模态任务上达到SOTA性能!...
《opencv学习笔记》-- 线性滤波:方框滤波、均值滤波、高斯滤波
毕业季-个人总结
03-存储系统
Comment configurer un accord
【MySQL从入门到精通】【高级篇】(四)MySQL权限管理与控制
Alcohol driving monitoring system based on stm32+ Huawei cloud IOT design
[C language] Pointer written test questions
LeetCode 1200 最小绝对差[排序] HERODING的LeetCode之路
flink sql-client. SH tutorial
Digi重启XBee-Pro S2C生产,有些差别需要注意
Talk about 10 tips to ensure thread safety
LVGL 8.2 List
Docker compose public network deployment redis sentinel mode
remount of the / superblock failed: Permission denied
炒股网上开户安全吗?会不会被骗。
Redis daily notes
Chapter 17 process memory