redhat的openshift云开发平台文档学习
推荐的文档版本已经不支持了
https://docs.openshift.com/container-platform/4.1/applications/operators/olm-what-operators-are.html#olm-maturity-model_olm-what-operators-are
最新的版本是4,看4的文档
https://docs.openshift.com/container-platform/4.5/operators/olm-what-operators-are.html
理解operators
- 通俗:类似软件供应商工程队伍的拓展,可以监视k8s环境,实时决策。高级operator可以无缝升级系统,对故障自动反应,有着比较完备的流程。
- 技术:operator是打包、部署、管理k8s应用程序的一种方式
- 实现:Operators as the runtime that manages this your apps on Kubernetes.
operator产生的原因
-
作用
- 实现安装和升级的可重复性
- 实现系统组件的常规检查
- Over-the-air (OTA) updates for OpenShift components and ISV content
- 领域工程师的知识融会到operator中
-
operator选择k8s作为平台
- k8s包含建立分布式系统的大部分primitives,比如secret handling,负载均衡,服务发现,自动扩容;可以在本地和云服务上部署
-
使用k8s apis和kubectl工具管理app
- apis很强大:have clients for all platforms and plug into the cluster’s access control/auditing
- operator可以基于k8s的扩展机制(实现个性化的CRD custom resource definitions):比如自定义mongodb,看起来就像是内嵌在k8s的原生objects
-
operator和service brokers的区别
- service brokers关注programmatic discovery and deployment of an app,并不支持升级、故障处理和扩展。operator可以一直监控集群状态并针对状态实时响应
- Off-cluster services continue to be a good match for a Service Broker, although Operators exist for these as well.
operator framework
- operator sdk:软件开发工具包software development kit。操作人员不需要了解k8s api,就可以实现operator的bootstrapping, building, testing, and packaging
- operator lifecycle manager:掌控operator在集群中的安装、升级和角色控制
- operator registry:存储ClusterServiceVersions (CSVs) and Custom Resource Definitions (CRDs);存储Operator metadata about packages and channels;将operator的目录数据提供给OLM(operator lifecycle manager)
- operator hub:a web console for cluster administrators to discover and select Operators to install on their cluster.类似于dockerhub
- operator metering:收集operator在集群上的指标
Operator maturity model 成熟度模型(可参考原文的图)
- dependent on the type of the service represented by the Operator.
- 五个阶段
- basic install:自动实现实例创建和配置管理
- seamless upgrades:支持打包和小版本的更新
- full lifecycle:支持生命周期的管理(备份和恢复)
- deep insights:监控、警告、日志处理、workload分析等
- auto pilot:支持水平扩容、垂直扩容、自动参数调优、异常检测和调度优化