1.4.3.2. 协调频率 Helm 频道
每 15 分钟,订阅 operator 将当前部署 Helm chart 的哈希值与源仓库的哈希值进行比较。更改被应用到目标集群。资源协调的频率会影响其他应用程序部署和更新的性能。
例如,如果存在数百个应用程序订阅,并且您希望更频繁地协调所有订阅,则协调的响应时间会较慢。
根据应用程序的 Kubernetes 资源,适当的协调频率可以提高性能。
-
Off:不自动协调部署的资源。Subscription 自定义资源的更改会启动协调。您可以添加或更新标签或注解。 -
Low:订阅 operator 每小时将当前部署的哈希值与源存储库的哈希进行比较,并在发生更改时对目标集群应用更改。 -
Medium:这是默认设置。订阅 operator 每 15 分钟将当前部署的哈希值与源存储库的哈希进行比较,并在发生更改时对目标集群应用更改。 -
High:订阅 operator 每 2 分钟将当前部署的哈希值与源存储库的哈希进行比较,并在有更改时对目标集群应用更改。
您可以使用订阅引用的 Channel 自定义资源中的 apps.open-cluster-management.io/reconcile-rate 注解进行设置。请参阅以下 helm-channel 示例:
请参阅以下 helm-channel 示例:
apiVersion: apps.open-cluster-management.io/v1
kind: Channel
metadata:
name: helm-channel
namespace: sample
annotations:
apps.open-cluster-management.io/reconcile-rate: low
spec:
type: HelmRepo
pathname: <Helm repo URL>
---
apiVersion: apps.open-cluster-management.io/v1
kind: Subscription
metadata:
name: helm-subscription
spec:
channel: sample/helm-channel
name: nginx-ingress
packageOverrides:
- packageName: nginx-ingress
packageAlias: nginx-ingress-simple
packageOverrides:
- path: spec
value:
defaultBackend:
replicaCount: 3
placement:
local: true
在本例中,所有使用 sample/helm-channel 的订阅都会被分配一个 low 协调频率。
无论频道中的 reconcile-rate 设置是什么,订阅都可以通过在 Subscription 自定义资源中指定 apps.open-cluster-management.io/reconcile-rate: off 注解来关闭自动协调,如下例所示:
apiVersion: apps.open-cluster-management.io/v1
kind: Channel
metadata:
name: helm-channel
namespace: sample
annotations:
apps.open-cluster-management.io/reconcile-rate: high
spec:
type: HelmRepo
pathname: <Helm repo URL>
---
apiVersion: apps.open-cluster-management.io/v1
kind: Subscription
metadata:
name: helm-subscription
annotations:
apps.open-cluster-management.io/reconcile-rate: "off"
spec:
channel: sample/helm-channel
name: nginx-ingress
packageOverrides:
- packageName: nginx-ingress
packageAlias: nginx-ingress-simple
packageOverrides:
- path: spec
value:
defaultBackend:
replicaCount: 3
placement:
local: true
在本例中,helm-subscription 部署的资源永远不会自动协调,即使 reconcile-rate 在频道中被设置为 high。