• Operator Bundle简介


    一个operator bundle是一个特殊的container image。这个特殊的image存储了k8 manifests和与一个opearator相关联的metadata。一个bundle可以理解为一个特定版本的operator。

    一个operator bundle通常是non-runnable的,但是其可以在oci-compliant container registry上一个push和pull。最终的,这个operator bundle可以被operator registry和OLM所用,用来在支持OLM的cluster上安装operator。

    operator bundle格式

    1. $ tree operator-bundle-tet
    2. operator-bundle-tet
    3. ├── my-manifests
    4. │ ├── etcdcluster.crd.yaml
    5. │ └── etcdoperator.clusterserviceversion.yaml
    6. ├── metadata
    7. │ └── annotations.yaml
    8. └── Dockerfile

    bundle manfiest格式

    1. $ tree
    2. /
    3. ├── manifests
    4. │ ├── etcdcluster.crd.yaml
    5. │ └── etcdoperator.clusterserviceversion.yaml
    6. └── metadata
    7. ├── annotations.yaml
    8. └── dependencies.yaml

     

    其中, manifests和metadata的名字是可以改的,需要和annotations中的定义保持一致即可。

    Bundle Annotations

    annodations.yml

    1. annotations:
    2. operators.operatorframework.io.bundle.mediatype.v1: "registry+v1"
    3. operators.operatorframework.io.bundle.manifests.v1: "manifests/"
    4. operators.operatorframework.io.bundle.metadata.v1: "metadata/"
    5. operators.operatorframework.io.bundle.package.v1: "test-operator"
    6. reflects the list of channels the bundle is subscribing to when added into an operator registry
    7. operators.operatorframework.io.bundle.channels.v1: "beta,stable"
    8. operators.operatorframework.io.bundle.channel.default.v1: "stable"

    Bundle Dependencies

    一个operator的依赖被定义在dependencies.yaml文件中。

     

    1. dependencies:
    2. - type: olm.package
    3. value:
    4. packageName: prometheus
    5. version: ">0.27.0"
    6. - type: olm.gvk
    7. value:
    8. group: etcd.database.coreos.com
    9. kind: EtcdCluster
    10. version: v1beta2

    Bundle Dockerfile

    1. FROM scratch
    2. # We are pushing an operator-registry bundle
    3. # that has both metadata and manifests.
    4. LABEL operators.operatorframework.io.bundle.mediatype.v1=registry+v1
    5. LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
    6. LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
    7. LABEL operators.operatorframework.io.bundle.package.v1=test-operator
    8. LABEL operators.operatorframework.io.bundle.channels.v1=beta,stable
    9. LABEL operators.operatorframework.io.bundle.channel.default.v1=stable
    10. ADD test/*.yaml /manifests
    11. ADD test/metadata/annotations.yaml /metadata/annotations.yaml
  • 相关阅读:
    JavaEE中的Lambda表达式与方法引用的使用
    环境变量小节
    day2【代码随想录】移除元素
    Redis——新数据类型
    手边酒店V2独立版小程序 1.0.21 免授权+小程序前端安装教程
    手动从0搭建ABP框架-ABP官方完整解决方案和手动搭建简化解决方案实践
    Skywalking Swck Agent注入实现分析
    微信小程序自定义按钮触发转发分享功能
    基于python+django+vue+MySQL的酒店推荐系统
    链表(一)----关于单链表的一切细节这里都有
  • 原文地址:https://blog.csdn.net/solinger/article/details/125481646