自定义同步忽略配置模板
该功能用于创建 GitOps 应用时,能够在 同步忽略配置 模板列表中选择 自定义模板 实现忽略配置。
操作步骤
-
在左侧导航栏中,单击 集群管理 > 资源管理。
-
切换至 global 集群,单击 创建资源对象。
-
将下述配置信息写入到 YAML 文件中。
apiVersion: gitops.app.alauda.io/v1alpha1 kind: GitOpsIgnoreDifferences metadata: name: hpa namespace: kube-public displayName: zh: 水平伸缩(HPA)场景忽略配置 en: Ignore configurations in Horizontal Pod Autoscaling (HPA) scenarios description: zh: 忽略部署和有状态副本集资源对象的副本数字段,由水平伸缩控制器根据监控指标动态设置副本数。 en: The replica count fields in Deployment and StatefulSet resources will be ignored. The number of replicas will be dynamically adjusted by the HPA controller based on monitoring metrics. ignoreDifferences: - group: apps jsonPointers: - /spec/replicas kind: Deployment - group: apps jsonPointers: - /spec/replicas kind: StatefulSet字段说明:
-
name:自定义模板名称,禁止与平台中已有的模板名称相同。
-
displayName:选择 同步忽略配置 模板时,下拉选择框中显示的模板名称。
-
description:模板的描述信息,建议将忽略的字段信息描述完整,方便后续使用。例如:忽略部署和有状态副本集资源对象的副本数字段,由水平伸缩控制器根据监控指标动态设置副本数。
-
ignoreDifferences:用于标识对应资源文件中需要忽略的字段。
-