You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: deploy-manage/deploy/cloud-on-k8s/elastic-stack-configuration-policies.md
+12-6Lines changed: 12 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,7 @@ At least one of `spec.elasticsearch` or `spec.kibana` needs to be defined with a
83
83
84
84
The following fields are optional:
85
85
86
-
*`weight` is an integer that determines the priority of this policy when multiple policies target the same resource. Lower weight values have higher priority. The default value is `0`. When multiple policies have the same `weight` value and target the same resource, the operator reports a conflict.
86
+
*`weight` is an integer that determines the priority of this policy when multiple policies target the same resource. [introduced in ECK `3.3.0` - See [Policy priority and weight](#k8s-stack-config-policy-priority-weight) for details]
87
87
*`namespace` is the namespace of the `StackConfigPolicy` resource and used to identify the {{es}} clusters and {{kib}} instances to which the policy applies. If it equals to the operator namespace, the policy applies to all namespaces managed by the operator, otherwise the policy only applies to the namespace of the policy.
88
88
*`resourceSelector` is a [label selector](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/) to identify the {{es}} clusters and {{kib}} instances to which the policy applies in combination with the namespace(s). No `resourceSelector` means all {{es}} clusters and {{kib}} instances in the namespace(s).
89
89
@@ -289,7 +289,7 @@ spec:
289
289
indices.recovery.max_bytes_per_sec: "100mb"
290
290
```
291
291
292
-
In this example, both policies target the same Elasticsearch cluster (using the `cluster: my-cluster` label). The `high-priority-policy` (weight: 0) is applied because it has a lower weight value. The `low-priority-policy` (weight: 100) is ignored for that cluster. If both policies have the same `weight` value, the operator reports a conflict. Refer to [Policy priority and weight](#k8s-stack-config-policy-priority-weight) for more details on how weight determines policy priority.
292
+
In this example, both policies target the same Elasticsearch cluster (using the `cluster: my-cluster` label). The `high-priority-policy` (weight: 0) settings take precedence and overwrite the `low-priority-policy` (weight: 100) settings. The `low-priority-policy` settings are applied first, then the `high-priority-policy` settings overwrite them. If both policies have the same `weight` value, a conflict occurs and no policies are applied to the cluster until the conflict is resolved. See [Policy priority and weight](#k8s-stack-config-policy-priority-weight) for more details on how weight determines policy priority and conflict resolution.
@@ -359,13 +359,19 @@ In order to avoid a conflict between multiple {{es}} clusters writing their snap
359
359
360
360
## Policy priority and weight [k8s-stack-config-policy-priority-weight]
361
361
362
-
When multiple `StackConfigPolicy` resources target the same {{es}} cluster or {{kib}} instance, the `weight` field determines which policy takes precedence. The policy with the lowest `weight` value has the highest priority and is applied to the resource. Policies with higher `weight` values are ignored when a lower-weight policy also targets the same resource.
362
+
The `weight` field is an integer that determines the priority of a policy when multiple `StackConfigPolicy` resources target the same {{es}} cluster or {{kib}} instance. When multiple policies target the same resource, policies are evaluated in order of their `weight` values (from highest to lowest). Settings from policies with lower `weight` values take precedence and overwrite settings from policies with higher `weight` values. The policy with the lowest `weight` value has the highest priority.
363
363
364
-
The `weight` field is optional and defaults to `0` if not specified. If multiple policies have the same `weight` value and target the same resource, the operator reports a conflict and neither policy is applied until the conflict is resolved.
364
+
The `weight` field is optional and defaults to `0` if not specified. Lower weight values have higher priority.
365
+
366
+
::::{important}
367
+
**Conflict resolution**
368
+
369
+
If multiple policies have the same `weight` value and target the same resource, the operator reports a conflict. When a conflict occurs, **no policies are applied to that resource**—this includes not only the conflicting policies but also any other policies that target the same resource. The target resource remains unconfigured by any `StackConfigPolicy` until the conflict is resolved either by adjusting the `weight` values of the conflicting policies.
370
+
::::
365
371
366
372
This allows you to create a hierarchy of policies, for example:
367
373
* Base policies with higher weights (e.g., `weight: 100`) that provide default configurations
368
-
* Override policies with lower weights (e.g., `weight: 0`) that provide environment-specific or cluster-specific configurations
374
+
* Override policies with lower weights (e.g., `weight: 0`) that provide environment-specific or cluster-specific configurations and overwrite the base policy settings
369
375
370
376
Example of using `weight` to create a policy hierarchy:
371
377
@@ -401,7 +407,7 @@ spec:
401
407
indices.recovery.max_bytes_per_sec: "200mb"
402
408
```
403
409
404
-
In this example, clusters labeled with both `env: production` and `tier: critical` use the `production-override-policy` (weight: 0) settings, while other production clusters use the `base-policy` (weight: 100) settings.
410
+
In this example, clusters labeled with both `env: production` and `tier: critical` have the `production-override-policy` (weight: 0) settings applied, which overwrite the `base-policy` (weight: 100) settings. Other production clusters use only the `base-policy` (weight: 100) settings.
405
411
406
412
407
413
## Specifics for secret mounts [k8s-stack-config-policy-specifics-secret-mounts]
0 commit comments