Skip to content

Commit 9a87efc

Browse files
authored
Merge pull request #64949 from slovern/TELCODOCS-1085-fix
nit fixes: TELCODOCS-1085 - custom source CRs for PolicyGenTemplate CR
2 parents 1294dc9 + 23f5486 commit 9a87efc

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

modules/ztp-adding-new-content-to-gitops-ztp.adoc

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ Perform the following procedure to add new content to the {ztp} pipeline.
1111

1212
.Procedure
1313

14-
. Create a subdirectory, `source-crs`, in the directory containing the `kustomization.yaml` file for the `PolicyGenTemplate` CR.
14+
. Create a subdirectory named `source-crs` in the directory that contains the `kustomization.yaml` file for the `PolicyGenTemplate` custom resource (CR).
1515

16-
. Add your custom CRs to this folder, as shown in the following example:
16+
. Add your custom CRs to the `source-crs` subdirectory, as shown in the following example:
1717
+
1818
[source,text]
1919
----
@@ -26,17 +26,17 @@ example
2626
└── source-crs <1>
2727
├── PaoCatalogSource.yaml
2828
├── PaoSubscription.yaml
29-
├── bell
29+
├── custom-crs
3030
| ├── apiserver-config.yaml
3131
| └── disable-nic-lldp.yaml
3232
└── elasticsearch
3333
├── ElasticsearchNS.yaml
3434
└── ElasticsearchOperatorGroup.yaml
3535
----
36-
<1> The `sources-crs` subdirectory is in the same directory as the `kustomization.yaml` file.
36+
<1> The `source-crs` subdirectory must be in the same directory as the `kustomization.yaml` file.
3737

38-
. Update the required `PolicyGenTemplate` CRs to include references to the content you added in the `custom-crs` directory.
39-
+
38+
. Update the required `PolicyGenTemplate` CRs to include references to the content you added in the `source-crs/custom-crs` and `source-crs/elasticsearch` directories. For example:
39+
+
4040
[source,yaml]
4141
----
4242
apiVersion: ran.openshift.io/v1
@@ -68,8 +68,9 @@ spec:
6868
remediationAction: inform
6969
policyName: "group-dev-lso-operator-group"
7070
- fileName: StorageSubscription.yaml
71-
remediationAction: inform
72-
policyName: "group-dev-lso-sub"
71+
remediationAction: inform
72+
policyName: "group-dev-lso-sub"
73+
#These are custom local polices that come from the source-crs directory in the git repo
7374
# Performance Addon Operator
7475
- fileName: PaoSubscriptionNS.yaml
7576
remediationAction: inform
@@ -78,31 +79,30 @@ spec:
7879
remediationAction: inform
7980
policyName: "group-dev-pao-cat-source"
8081
spec:
81-
image: <image URL here>
82+
image: <image_URL_here>
8283
- fileName: PaoSubscription.yaml
83-
remediationAction: inform
84-
policyName: "group-dev-pao-sub"
85-
#These are custom local polices that come from the source-crs directory in the git repo
84+
remediationAction: inform
85+
policyName: "group-dev-pao-sub"
8686
#Elasticsearch Operator
8787
- fileName: elasticsearch/ElasticsearchNS.yaml <1>
8888
remediationAction: inform
8989
policyName: "group-dev-elasticsearch-ns"
9090
- fileName: elasticsearch/ElasticsearchOperatorGroup.yaml
9191
remediationAction: inform
9292
policyName: "group-dev-elasticsearch-operator-group"
93-
#Bell Custom Resources
94-
- fileName: bell/apiserver-config.yaml
95-
remediationAction: inform
96-
policyName: "group-dev-apiserver-config"
97-
- fileName: bell/disable-nic-lldp.yaml
98-
remediationAction: inform
99-
policyName: "group-dev-disable-nic-lldp"
93+
#Custom Resources
94+
- fileName: custom-crs/apiserver-config.yaml <1>
95+
remediationAction: inform
96+
policyName: "group-dev-apiserver-config"
97+
- fileName: custom-crs/disable-nic-lldp.yaml
98+
remediationAction: inform
99+
policyName: "group-dev-disable-nic-lldp"
100100
----
101-
<1> Set `fileName` to include the custom CR subfolder from the `/source-crs` parent.
101+
<1> Set `fileName` to include the relative path to the file from the `/source-crs` parent directory.
102102

103-
. Commit the `PolicyGenTemplate` change in Git, and then push to the Git repository being monitored by the GitOps ZTP Argo CD policies application.
103+
. Commit the `PolicyGenTemplate` change in Git, and then push to the Git repository that is monitored by the GitOps ZTP Argo CD policies application.
104104

105-
. Update the `ClusterGroupUpgrade` CR to include the changed `PolicyGenTemplate` and save it as `cgu-test.yaml`.
105+
. Update the `ClusterGroupUpgrade` CR to include the changed `PolicyGenTemplate` and save it as `cgu-test.yaml`. The following example shows a generated `cgu-test.yaml` file.
106106
+
107107
[source,yaml]
108108
----
@@ -123,26 +123,26 @@ spec:
123123
----
124124

125125
. Apply the updated `ClusterGroupUpgrade` CR by running the following command:
126-
[source, terminal]
127126
+
127+
[source,terminal]
128128
----
129129
$ oc apply -f cgu-test.yaml
130130
----
131131

132132
.Verification
133133

134-
. Check that the updates have succeeded by running the following command:
134+
* Check that the updates have succeeded by running the following command:
135135
+
136136
[source, terminal]
137137
----
138-
$ oc get cgu -A
138+
$ oc get cgu -A
139139
----
140140
+
141141
.Example output
142142
+
143143
[source, terminal]
144144
----
145145
NAMESPACE NAME AGE STATE DETAILS
146-
ztp-clusters custom-source-cr 6s InProgress Remediating non-compliant policies
146+
ztp-clusters custom-source-cr 6s InProgress Remediating non-compliant policies
147147
ztp-install cluster1 19h Completed All clusters are compliant with all the managed policies
148148
----

0 commit comments

Comments
 (0)