### K8S Controller 原理
---
[K8S Controller 原理](https://blog.zs-fighting.cn/upload/2022/03/Inside_of_Kubernetes_Controller-386116bc034c4d6ebcc16c86c1680197.pdf)
### Kubebuilder 使用
---
`Operator = Custom Resource + Custom Controller`
Operator项目汇总:`https://operatorhub.io/`


**用户只需要实现CRDs、Controllers**
**大部分工作主要实现 Controllers,实现步骤如下**
1. 加载命名的 CRD
2. 列出所有活动作业,并更新状态
3. 根据历史限制清理旧作业
4. 检查我们是否被暂停(如果我们被暂停,不要做任何其他事情)
5. 获取下一个计划运行
6. 如果新作业按计划运行,没有超过截止日期,并且没有被我们的并发策略阻止
7. 当我们看到正在运行的作业(自动完成)或下一次计划运行时重新排队。


K8S Controller 原理、Kubebuilder 使用