当前位置: 首页 > 工具软件 > operator-sdk > 使用案例 >

operator-sdk升级

吕淮晨
2023-12-01

operator sdk v0.x和v1.x的区别

operator sdk和kubebuilder整合后(以kubebuilder为主),operator sdk发布了v1.x版本,operator sdk的项目layout、scaffold、dependency、 usage、code等发生了变化

  1. 底层相似:under the hood using controller-runtime、controller-tools to adding a manager, api scheme and creates an structs implements a reconciler interface
  2. 整合项目:https://github.com/kubernetes-sigs/kubebuilder/projects/7, 2019年7月25日开始,2020年11月7日关闭了
  3. 未来规划:operator-sdk commit参与kubebuilder的开发维护;文档会将基于go的operator文档集成到kubebuilder文档,未来共同维护kubebuilder文档的更新
operator-sdkkubebuilder
projectpart of operator-framework,coreos开发维护one of the kubernetes-sigs
commitsmost are google, redhatmost are redhat
integrationThe operator-sdk has better integration with helm, and having better integration with the operator-framework ecosystemthe kuebuilder integrates with existing kubernetes-sigs projects

版本主要变化

主要参考链接:https://sdk.operatorframework.io/docs/building-operators/golang/migration/

  1. new layout:operator-sdk在向kubebuilder的layout靠拢
  2. scaffold:新增kustomize、kube-auth-proxy、envtest等
  3. dependency
    1. kubebuilder go CLI v2 to v3(operator-sdk v1.2对应kubebuilder v2; operator-sdk v1.4对应kubebuilder v3)
      1. The minimum Go version is now 1.15
      2. controller-runtime to v0.8.0(https://master.book.kubebuilder.io/migration/v2vsv3.html
      3. controller-tools to v0.4.1
      4. 新增:因为operator metrics需要kustomize ,Support for kustomize v3.8.7
    2. operator-lib v0.4.0 ,because of controller-runtime v0.8.0
    3. kubernetes:最高支持版本v1.19,低版本也支持(https://github.com/operator-framework/operator-sdk/releases/tag/v1.3.0)
  4. command
    1. operator-sdk generate crds is replaced with make manifests, which generates CRDs and RBAC rules.
    2. operator-sdk build is replaced with make docker-build IMG=/:tag
    3. …等
  5. code:func、interface等发生变化
 类似资料: