Skip to content

Commit c5a8104

Browse files
authored
Merge pull request #92956 from slovern/TELCODOCS-2123
TELCODOCS-2123 ACM PolicyGenerator recommendation
2 parents a243774 + af894b5 commit c5a8104

12 files changed

+67
-41
lines changed

edge_computing/cnf-talm-for-cluster-upgrades.adoc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
= Updating managed clusters with the {cgu-operator-full}
44
include::_attributes/common-attributes.adoc[]
55
:context: cnf-topology-aware-lifecycle-manager
6+
:policy-gen-cr: PolicyGenerator
67

78
toc::[]
89

910
You can use the {cgu-operator-first} to manage the software lifecycle of multiple clusters. {cgu-operator} uses {rh-rhacm-first} policies to perform changes on the target clusters.
1011

11-
:Featurename: Using PolicyGenerator resources with {ztp}
12-
include::snippets/technology-preview.adoc[]
12+
Using {rh-rhacm} and `{policy-gen-cr}` CRs is the recommended approach for managing policies and deploying them to managed clusters.
13+
This replaces the use of `PolicyGenTemplate` CRs for this purpose.
14+
For more information about `{policy-gen-cr}`resources, see the {rh-rhacm} link:https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/{rh-rhacm-version}/html/governance/policy-deployment#integrate-policy-generator[Policy Generator] documentation.
1315

1416
include::modules/cnf-about-topology-aware-lifecycle-manager-config.adoc[leveloffset=+1]
1517

@@ -55,3 +57,5 @@ include::modules/cnf-topology-aware-lifecycle-manager-troubleshooting.adoc[level
5557
* xref:../edge_computing/policygenerator_for_ztp/ztp-talm-updating-managed-policies-pg.adoc#ztp-topology-aware-lifecycle-manager[Updating managed policies with {cgu-operator-full}]
5658
5759
* xref:../edge_computing/policygenerator_for_ztp/ztp-configuring-managed-clusters-policygenerator.adoc#ztp-the-policygentemplate_ztp-configuring-managed-clusters-policygenerator[About the PolicyGenerator CRD]
60+
61+
:!policy-gen-cr:

edge_computing/policygenerator_for_ztp/ztp-advanced-policygenerator-config.adoc

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,14 @@ include::_attributes/common-attributes.adoc[]
77
:policy-prefix: acm-
88
:rangen-yaml-path: policies.manifests
99
:argocd-folder: out/argocd/example/acmpolicygenerator/
10+
:path-prefix: acmpolicygenerator
1011

1112
toc::[]
1213

1314
You can use `{policy-gen-cr}` CRs to deploy custom functionality in your managed clusters.
14-
15-
:Featurename: Using PolicyGenerator resources with {ztp}
16-
include::snippets/technology-preview.adoc[]
17-
18-
[NOTE]
19-
====
20-
For more information about `PolicyGenerator` resources, see the {rh-rhacm} link:https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/{rh-rhacm-version}/html/governance/integrate-policy-generator#policy-generator[Policy Generator] documentation.
21-
====
15+
Using {rh-rhacm} and `{policy-gen-cr}` CRs is the recommended approach for managing policies and deploying them to managed clusters.
16+
This replaces the use of `PolicyGenTemplate` CRs for this purpose.
17+
For more information about `{policy-gen-cr}` resources, see the {rh-rhacm} link:https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/{rh-rhacm-version}/html/governance/policy-deployment#integrate-policy-generator[Policy Generator] documentation.
2218

2319
include::modules/ztp-deploying-additional-changes-to-clusters.adoc[leveloffset=+1]
2420

@@ -103,3 +99,4 @@ include::modules/ztp-configuring-pgt-image-registry.adoc[leveloffset=+2]
10399
:!policy-prefix:
104100
:!rangen-yaml-path:
105101
:!argocd-folder:
102+
:!path-prefix:

edge_computing/policygenerator_for_ztp/ztp-configuring-managed-clusters-policygenerator.adoc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,12 @@ include::_attributes/common-attributes.adoc[]
1111

1212
toc::[]
1313

14-
Applied `Policy` custom resources (CRs) configure the managed clusters that you provision. You can customize how {rh-rhacm-first} uses `{policy-gen-cr}` CRs to generate the applied `Policy` CRs.
14+
You can customize how {rh-rhacm-first} uses `{policy-gen-cr}` CRs to generate `Policy` CRs that configure the managed clusters that you provision.
1515

16-
:Featurename: Using PolicyGenerator resources with {ztp}
17-
include::snippets/technology-preview.adoc[]
16+
Using {rh-rhacm} and `{policy-gen-cr}` CRs is the recommended approach for managing policies and deploying them to managed clusters.
17+
This replaces the use of `PolicyGenTemplate` CRs for this purpose.
18+
For more information about `{policy-gen-cr}` resources, see the {rh-rhacm} link:https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/{rh-rhacm-version}/html/governance/policy-deployment#integrate-policy-generator[Policy Generator] documentation.
1819

19-
[NOTE]
20-
====
21-
For more information about `PolicyGenerator` resources, see the {rh-rhacm} link:https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/{rh-rhacm-version}/html-single/governance/index#integrate-policy-generator[Integrating Policy Generator] documentation.
22-
====
2320

2421
include::modules/ztp-comparing-pgt-and-rhacm-pg-patching-strategies.adoc[leveloffset=+1]
2522

edge_computing/policygentemplate_for_ztp/ztp-advanced-policy-config.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,17 @@ include::_attributes/common-attributes.adoc[]
77
:policy-prefix:
88
:rangen-yaml-path: spec.sourceFiles
99
:argocd-folder: out/argocd/example/policygentemplates/
10+
:path-prefix: policygentemplates
1011

1112
toc::[]
1213

1314
You can use `{policy-gen-cr}` CRs to deploy custom functionality in your managed clusters.
15+
[IMPORTANT]
16+
====
17+
Using {rh-rhacm} and `{policy-gen-cr}` CRs is the recommended approach for managing policies and deploying them to managed clusters.
18+
This replaces the use of `PolicyGenTemplate` CRs for this purpose.
19+
For more information about `{policy-gen-cr}` resources, see the {rh-rhacm} link:https://docs.redhat.com/en/documentation/red_hat_advanced_cluster_management_for_kubernetes/{rh-rhacm-version}/html/governance/policy-deployment#integrate-policy-generator[Policy Generator] documentation.
20+
====
1421

1522
include::snippets/pgt-deprecation-notice.adoc[]
1623

@@ -101,3 +108,4 @@ include::modules/ztp-configuring-pgt-image-registry.adoc[leveloffset=+2]
101108
:!policy-prefix:
102109
:!rangen-yaml-path:
103110
:!argocd-folder:
111+
:!path-prefix:

modules/cnf-about-topology-aware-lifecycle-manager-policies.adoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ Supported use cases include the following:
1414
* Manual user creation of policy CRs
1515
* Automatically generated policies from the `PolicyGenerator` or `PolicyGentemplate` custom resource definition (CRD)
1616
17+
[NOTE]
18+
====
19+
Using the `PolicyGentemplate` CRD is the recommended method for automatic policy generation.
20+
====
21+
1722
For policies that update an Operator subscription with manual approval, {cgu-operator} provides additional functionality that approves the installation of the updated Operator.
1823

1924
For more information about managed policies, see link:https://access.redhat.com/documentation/en-us/red_hat_advanced_cluster_management_for_kubernetes/{rh-rhacm-version}/html-single/governance/index#policy-overview[Policy Overview] in the {rh-rhacm} documentation.

modules/cnf-topology-aware-lifecycle-manager-about-subscription-crs.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ metadata:
2323
annotations:
2424
ran.openshift.io/ztp-deploy-wave: "2"
2525
spec:
26-
channel: "stable"
26+
channel: "stable-6.2"
2727
name: cluster-logging
28-
source: redhat-operators
28+
source: redhat-operators-disconnected
2929
sourceNamespace: openshift-marketplace
3030
installPlanApproval: Manual
3131
status:

modules/cnf-topology-aware-lifecycle-manager-apply-policies.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,5 +370,5 @@ $ oc get csv -n <operator_namespace>
370370
[source,terminal]
371371
----
372372
NAME DISPLAY VERSION REPLACES PHASE
373-
cluster-logging.5.4.2 Red Hat OpenShift Logging 5.4.2 Succeeded
373+
cluster-logging.v6.2.1 Red Hat OpenShift Logging 6.2.1 Succeeded
374374
----

modules/ztp-configuring-cluster-policies.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
:_mod-docs-content-type: CONCEPT
66
[id="ztp-configuring-cluster-policies_{context}"]
7-
= Configuring managed clusters with policies and PolicyGenTemplate resources
7+
= Configuring managed clusters with policies and {policy-gen-cr} resources
88

99
{ztp-first} uses {rh-rhacm-first} to configure clusters by using a policy-based governance approach to applying the configuration.
1010

11-
The policy generator or `PolicyGen` is a plugin for the GitOps Operator that enables the creation of {rh-rhacm} policies from a concise template. The tool can combine multiple CRs into a single policy, and you can generate multiple policies that apply to various subsets of clusters in your fleet.
11+
The policy generator is a plugin for the GitOps Operator that enables the creation of {rh-rhacm} policies from a concise template. The tool can combine multiple CRs into a single policy, and you can generate multiple policies that apply to various subsets of clusters in your fleet.
1212

1313
[NOTE]
1414
====
@@ -35,7 +35,7 @@ The following recommended structuring of policies combines configuration CRs to
3535
3636
* Support flexibility in common configurations for cluster variants.
3737
38-
.Recommended PolicyGenTemplate policy categories
38+
.Recommended {policy-gen-cr} policy categories
3939
[cols="1,5", width="100%", options="header"]
4040
|====
4141
|Policy category

modules/ztp-enabling-workload-partitioning-sno.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Both of these steps happen at different points during cluster provisioning.
1818
Configuring workload partitioning by using the `cpuPartitioningMode` field in the `SiteConfig` CR is a Tech Preview feature in {product-title} 4.13.
1919
2020
Alternatively, you can specify cluster management CPU resources with the `cpuset` field of the `SiteConfig` custom resource (CR) and the `reserved` field of the group `PolicyGenerator` or `PolicyGentemplate` CR.
21+
The `{policy-gen-cr}` CR is the recommended approach.
2122
The {ztp} pipeline uses these values to populate the required fields in the workload partitioning `MachineConfig` CR (`cpuset`) and the `PerformanceProfile` CR (`reserved`) that configure the {sno} cluster.
2223
This method is a General Availability feature in {product-title} 4.14.
2324
====

modules/ztp-image-based-upgrade-installing-lca.adoc

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -78,25 +78,39 @@ status:
7878
----
7979
--
8080

81-
. Add the CRs to your common `PolicyGenTemplate`:
81+
. Add the CRs to your common PolicyGenerator:
8282
+
8383
[source,yaml]
8484
----
85-
apiVersion: ran.openshift.io/v1
86-
kind: PolicyGenTemplate
85+
apiVersion: policy.open-cluster-management.io/v1
86+
kind: PolicyGenerator
8787
metadata:
88-
name: "example-common-latest"
89-
namespace: "ztp-common"
90-
spec:
91-
bindingRules:
92-
common: "true"
93-
du-profile: "latest"
94-
sourceFiles:
95-
- fileName: LcaSubscriptionNS.yaml
96-
policyName: "subscriptions-policy"
97-
- fileName: LcaSubscriptionOperGroup.yaml
98-
policyName: "subscriptions-policy"
99-
- fileName: LcaSubscription.yaml
100-
policyName: "subscriptions-policy"
88+
name: common-latest
89+
placementBindingDefaults:
90+
name: common-placement-binding
91+
policyDefaults:
92+
namespace: ztp-common
93+
placement:
94+
labelSelector:
95+
common: "true"
96+
du-profile: "latest"
97+
remediationAction: inform
98+
severity: low
99+
namespaceSelector:
100+
exclude:
101+
- kube-*
102+
include:
103+
- '*'
104+
evaluationInterval:
105+
compliant: 10m
106+
noncompliant: 10s
107+
policies:
108+
- name: common-latest-subscriptions-policy
109+
policyAnnotations:
110+
ran.openshift.io/ztp-deploy-wave: "2"
111+
manifests:
112+
- path: source-crs/LcaSubscriptionNS.yaml
113+
- path: source-crs/LcaSubscriptionOperGroup.yaml
114+
- path: source-crs/LcaSubscription.yaml
101115
[...]
102116
----

modules/ztp-using-pgt-to-update-source-crs.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ spec:
126126
====
127127
In the `/source-crs` folder that you extract from the `ztp-site-generate` container, the `$` syntax is not used for template substitution as implied by the syntax. Rather, if the `policyGen` tool sees the `$` prefix for a string and you do not specify a value for that field in the related `{policy-gen-cr}` CR, the field is omitted from the output CR entirely.
128128
129-
An exception to this is the `$mcp` variable in `/source-crs` YAML files that is substituted with the specified value for `mcp` from the `{policy-gen-cr}` CR. For example, in `example/policygentemplates/{policy-prefix}group-du-standard-ranGen.yaml`, the value for `mcp` is `worker`:
129+
An exception to this is the `$mcp` variable in `/source-crs` YAML files that is substituted with the specified value for `mcp` from the `{policy-gen-cr}` CR. For example, in `example/{path-prefix}/{policy-prefix}group-du-standard-ranGen.yaml`, the value for `mcp` is `worker`:
130130
131131
[source,yaml]
132132
----

snippets/ztp_example-sno.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ spec:
4040
# These example cluster labels correspond to the bindingRules in the PolicyGenTemplate examples
4141
du-profile: "latest"
4242
# These example cluster labels correspond to the bindingRules in the PolicyGenTemplate examples in ../policygentemplates:
43-
# ../policygentemplates/common-ranGen.yaml will apply to all clusters with 'common: true'
43+
# ../acmpolicygenerator/common-ranGen.yaml will apply to all clusters with 'common: true'
4444
common: true
4545
# ../policygentemplates/group-du-sno-ranGen.yaml will apply to all clusters with 'group-du-sno: ""'
4646
group-du-sno: ""

0 commit comments

Comments
 (0)