本文档采用自动化机器翻译技术翻译。 尽管我们力求提供准确的译文,但不对翻译内容的完整性、准确性或可靠性作出任何保证。 若出现任何内容不一致情况,请以原始 英文 版本为准,且原始英文版本为权威文本。

附加产品开发指南

SUSE Virtualization 附加产品允许您根据需求启用和禁用特定的产品和第三方组件。附加产品作为 SUSE® Rancher Prime: RKE2 HelmChart 资源定义 (CRD) 的封装程序。

先决条件

  • 现有的 SUSE Virtualization 集群

附加产品规范

Addon CRD 支持以下字段:

apiVersion: harvesterhci.io/v1beta1
kind: Addon
metadata:
  name: example-add-on           # Name of add-on
  namespace: example-namespace  # Namespace where the add-on CRD is deployed and where the associated Kubernetes components will be deployed
  labels:                       # Optional add-on labels
    Add-on.harvesterhci.io/experimental: "true" # Predefined label used on the UI to identify add-ons with the "experimental" maturity level
spec:
  enabled: false                # Boolean indicating if an add-on should be enabled or disabled on definition
  repo: https://chartsrepo.com  # Helm chart repository containing the Helm chart managed by the add-on
  version: "v0.19.0"            # Version of the Helm chart to be installed
  chart: mychart                # Name of the Helm chart in the Helm chart repository
  valuesContent: |-             # File (values.yaml) that must be passed to the Helm chart
    contents of values.yaml
    that need to be passed
    to the chart

实验性附加产品未直接打包在 SUSE Virtualization 软件包中。一个例子是 rancher-vcluster 附加产品。

安装

kubectl apply -f /path/to/add-on.yaml

用法

创建 Addon CRD 后,您可以切换 enabled 字段以启用和禁用相关的 HelmChart。

升级

repoversionchartvalueContent 字段的更改将触发 helm upgrade,这会强制升级现有的 HelmChart。

卸装

kubectl delete -f /path/to/Add-on.yaml