Version: v1.2

获取更多

KubeVela 中的模块完全都是可定制和可插拔的,所以除了内置的运维能力之外,你还可以通过如下的方式添加更多你自己的运维能力。

1. 从官方或第三方能力中心获取模块化能力

查看能力中心的模块列表

默认情况下,命令会从 KubeVela 官方维护的能力中心中获取模块化功能。

例如,让我们尝试列出能力中心中所有可用的 trait:

  1. $ vela trait --discover
  2. Showing trait definition from registry: default
  3. I1025 19:18:59.276330 80303 request.go:665] Waited for 1.042612105s due to client-side throttling, not priority and fairness, request: GET:https://127.0.0.1:63926/apis/standard.oam.dev/v1alpha1?timeout=32s
  4. NAME REGISTRY DEFINITION APPLIES-TO STATUS
  5. autoscale default autoscalers.standard.oam.dev [deployments.apps] uninstalled
  6. crd-manual-scaler default manualscalertraits.core.oam.dev [deployments.apps] uninstalled
  7. dynamic-sa default [deployments.apps] uninstalled
  8. env default [deployments.apps] installed
  9. expose default [] installed
  10. hpa default [deployments.apps] uninstalled
  11. init-container default [deployments.apps] installed
  12. kautoscale default [deployments.apps] uninstalled
  13. metrics default metricstraits.standard.oam.dev [deployments.apps jobs.batch] uninstalled
  14. node-affinity default [deployments.apps] installed
  15. rollout default canaries.flagger.app [deployments.apps] installed
  16. route default routes.standard.oam.dev [deployments.apps] uninstalled
  17. virtualgroup default [deployments.apps] uninstalled

--discover 表明将从能力中心发现能力并列出

从能力中心安装模块

然后你可以安装一个 trait,如:

  1. $ vela trait get init-container
  2. Getting component definition from registry: default
  3. Installing component: init-container
  4. Successfully install trait: init-container

2. 自定义模块化能力