Operator

TPR(Third Party Resource) 在k8s 1.7 被集成,并命名为CRD(Custom Resource Definition).

通过CRD,K8S可以动态的添加和管理资源,controller跟踪这些资源。

CRD+custom Controller = decalartive API(声明式API),一般分为通用性controller和operator.

通用型controller一般用于平台需求,operator一般用于部署特定应用.

用于开发operator的工具有kubebuilder和operator-sdk, 他们都是基于controller-runtime开发.

https://github.com/operator-framework/awesome-operators

https://operatorhub.io/

开发示例:

https://github.com/kubernetes/sample-controller

operator-sdk

redhat的operator-sdk可以方便的开发opeartor.

https://github.com/operator-framework/operator-sdk


kubebuilder

sig维护的kubebuilder也能方便的开发operator.

https://github.com/kubernetes-sigs/kubebuilder