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
= Changing applied managed cluster CRs using policies
8
8
9
-
You can remove content from a custom resource (CR) deployed to a managed cluster through a policy.
9
+
You can remove content from a custom resource (CR) that is deployed in a managed cluster through a policy.
10
10
11
-
By default, all `Policy` CRs created from a `PolicyGenTemplate` CR have a`complianceType` set to `musthave`.
12
-
In this mode, when you remove a field from a CR, the value is removed from the policy but is not removed from the CR on the managed cluster.
13
-
A `musthave` policy without the removed field is still compliant because the CR on the managed cluster has all the specified content.
11
+
By default, all `Policy` CRs created from a `PolicyGenTemplate` CR have the`complianceType` field set to `musthave`.
12
+
A `musthave` policy without the removed content is still compliant because the CR on the managed cluster has all the specified content.
13
+
In this configuration, when you remove content from a CR, {cgu-operator} removes it from the policy but the content is not removed from the CR on the managed cluster.
14
14
15
-
To remove the content from the managed cluster, set the `complianceType` field to `mustonlyhave`.
16
-
In this mode, the policy ensures that the CR on the cluster is an exact match of what is specified in the policy.
15
+
With the `complianceType` field to `mustonlyhave`, the policy ensures that the CR on the cluster is an exact match of what is specified in the policy.
17
16
18
17
.Prerequisites
19
18
@@ -27,7 +26,7 @@ In this mode, the policy ensures that the CR on the cluster is an exact match of
27
26
28
27
.Procedure
29
28
30
-
. Remove the content that you no longer need from the affected CRs. In this example, the `disableDrain: false` line should be removed from the `SriovOperatorConfig` CR.
29
+
. Remove the content that you no longer need from the affected CRs. In this example, the `disableDrain: false` line was removed from the `SriovOperatorConfig` CR.
31
30
+
32
31
.Example CR
33
32
@@ -38,28 +37,27 @@ kind: SriovOperatorConfig
38
37
metadata:
39
38
name: default
40
39
namespace: openshift-sriov-network-operator
41
-
annotations:
42
-
ran.openshift.io/ztp-deploy-wave: "10"
43
40
spec:
44
41
configDaemonNodeSelector:
45
42
"node-role.kubernetes.io/$mcp": ""
46
-
disableDrain: true <1>
43
+
disableDrain: true
47
44
enableInjector: true
48
45
enableOperatorWebhook: true
49
46
----
50
-
<1> Remove the `disableDrain: true` line.
51
47
52
48
. Change the `complianceType` of the affected policies to `mustonlyhave` in the `group-du-sno-ranGen.yaml` file.
53
49
+
54
50
.Example YAML
55
51
[source,yaml]
56
52
----
53
+
# ...
57
54
- fileName: SriovOperatorConfig.yaml
58
55
policyName: "config-policy"
59
56
complianceType: mustonlyhave
57
+
# ...
60
58
----
61
59
62
-
. Create a `ClusterGroupUpdates` CR and specify the clusters you want to deploy the changes to:
60
+
. Create a `ClusterGroupUpdates` CR and specify the clusters that must receive the CR changes::
0 commit comments