Skip to content

Commit bdae00c

Browse files
authored
Merge pull request #80111 from amolnar-rh/TELCODOCS-1861
TELCODOCS-1861: Lifecycle Agent Enhancements 4.17
2 parents e48be1b + 48e59df commit bdae00c

12 files changed

+537
-86
lines changed

edge_computing/image_based_upgrade/cnf-understanding-image-based-upgrade.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ include::modules/cnf-image-based-upgrade.adoc[leveloffset=+1]
7676
7777
* xref:../../edge_computing/image_based_upgrade/cnf-image-based-upgrade-base.adoc#cnf-image-based-upgrade[Performing an image-based upgrade for {sno} clusters with {lcao}]
7878
79+
* xref:../../edge_computing/image_based_upgrade/ztp-image-based-upgrade.adoc#ztp-image-based-upgrade[Performing an image-based upgrade for {sno} clusters using {ztp}]
80+
7981
include::modules/cnf-image-based-upgrade-guidelines.adoc[leveloffset=+1]
8082

8183
[role="_additional-resources"]

edge_computing/image_based_upgrade/ztp-image-based-upgrade.adoc

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,53 @@ include::_attributes/common-attributes.adoc[]
66

77
toc::[]
88

9+
// Lifecycle Agent (LCA)
10+
911
You can use a single resource on the hub cluster, the `ImageBasedGroupUpgrade` custom resource (CR), to manage an imaged-based upgrade on a selected group of managed clusters through all stages.
1012
{cgu-operator-first} reconciles the `ImageBasedGroupUpgrade` CR and creates the underlying resources to complete the defined stage transitions, either in a manually controlled or a fully automated upgrade flow.
1113

12-
// Lifecycle Agent (LCA)
13-
14-
include::modules/ztp-image-based-upgrade-concept.adoc[leveloffset=+1]
14+
For more information about the image-based upgrade, see "Understanding the image-based upgrade for single-node OpenShift clusters".
1515

1616
[role="_additional-resources"]
1717
.Additional resources
1818

19-
* xref:../../backup_and_restore/control_plane_backup_and_restore/disaster_recovery/scenario-3-expired-certs.adoc#dr-scenario-3-recovering-expired-certs_dr-recovering-expired-certs[Recovering from expired control plane certificates]
19+
* xref:../../edge_computing/image_based_upgrade/cnf-understanding-image-based-upgrade.adoc#cnf-understanding-image-based-upgrade[Understanding the image-based upgrade for single-node OpenShift clusters]
20+
21+
include::modules/ztp-image-based-upgrade-concept.adoc[leveloffset=+1]
2022

21-
////
22-
* xref:../../edge_computing/ztp-preparing-the-hub-cluster.adoc#ztp-preparing-the-ztp-git-repository-ver-ind_ztp-preparing-the-hub-cluster[Preparing the {ztp} site configuration repository for version independence]
23+
include::modules/ztp-image-based-upgrade-procedure-steps.adoc[leveloffset=+1]
2324

24-
* xref:../../edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/ztp-image-based-upgrade-prep-resources.adoc#ztp-image-based-upgrade-prep-resources[Creating ConfigMap objects for the image-based upgrade with {lcao} using {ztp}]
25+
[role="_additional-resources"]
26+
.Additional resources
2527

2628
* xref:../../edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/cnf-image-based-upgrade-shared-container-partition.adoc#ztp-image-based-upgrade-shared-container-partition_shared-container-partition[Configuring a shared container partition between ostree stateroots when using {ztp}]
2729
30+
* xref:../../edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/ztp-image-based-upgrade-prep-resources.adoc#ztp-image-based-upgrade-prep-resources[Creating ConfigMap objects for the image-based upgrade with {lcao} using {ztp}]
31+
2832
* xref:../../backup_and_restore/application_backup_and_restore/installing/installing-oadp-ocs.adoc#oadp-about-backup-snapshot-locations_installing-oadp-ocs[About backup and snapshot locations and their secrets]
2933
3034
* xref:../../backup_and_restore/application_backup_and_restore/backing_up_and_restoring/oadp-creating-backup-cr.adoc#oadp-creating-backup-cr-doc[Creating a Backup CR]
3135
3236
* xref:../../backup_and_restore/application_backup_and_restore/backing_up_and_restoring/restoring-applications.adoc#oadp-creating-restore-cr_restoring-applications[Creating a Restore CR]
33-
////
37+
38+
* xref:../../edge_computing/image_based_upgrade/ztp-image-based-upgrade.adoc#ztp-image-based-upgrade-supported-combinations_ztp-gitops[Supported action combinations]
39+
40+
include::modules/ztp-image-based-upgrade-procedure-one-step.adoc[leveloffset=+1]
41+
42+
include::modules/ztp-image-based-upgrade-procedure-cancel.adoc[leveloffset=+1]
43+
44+
[role="_additional-resources"]
45+
.Additional resources
46+
47+
* xref:../../edge_computing/image_based_upgrade/ztp-image-based-upgrade.adoc#ztp-image-based-upgrade-supported-combinations_ztp-gitops[Supported action combinations]
48+
49+
include::modules/ztp-image-based-upgrade-procedure-rollback.adoc[leveloffset=+1]
50+
51+
[role="_additional-resources"]
52+
.Additional resources
53+
54+
* xref:../../edge_computing/image_based_upgrade/ztp-image-based-upgrade.adoc#ztp-image-based-upgrade-supported-combinations_ztp-gitops[Supported action combinations]
55+
56+
* xref:../../backup_and_restore/control_plane_backup_and_restore/disaster_recovery/scenario-3-expired-certs.adoc#dr-scenario-3-recovering-expired-certs_dr-recovering-expired-certs[Recovering from expired control plane certificates]
3457
3558
include::modules/cnf-image-based-upgrade-troubleshooting.adoc[leveloffset=+1]

modules/ztp-image-based-upgrade-prep-label-extramanifests.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Label your extra manifests so that the {lcao} can extract resources that are lab
1717
1818
.Procedure
1919

20-
. Label your required extra manifests with the `lca.openshift.io/target-ocp-version: <target_version>` label in your existing `PolicyGenTemplate` CR:
20+
. Label your required extra manifests with the `lca.openshift.io/target-ocp-version: <target_version>` label in your existing site `PolicyGenTemplate` CR:
2121
+
2222
[source,yaml]
2323
----

modules/ztp-image-based-upgrade-prep-oadp.adoc

Lines changed: 16 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// * edge_computing/image-based-upgrade/cnf-preparing-for-image-based-upgrade.adoc
33

44
:_mod-docs-content-type: PROCEDURE
5-
[id="zztp-image-based-upgrade-prep-oadp_{context}"]
5+
[id="ztp-image-based-upgrade-prep-oadp_{context}"]
66
= Creating {oadp-short} resources for the image-based upgrade with {ztp}
77

88
Prepare your {oadp-short} resources to restore your application after an upgrade.
@@ -16,6 +16,7 @@ Prepare your {oadp-short} resources to restore your application after an upgrade
1616
* Deploy a version of {lcao} that is compatible with the version used with the seed image.
1717
* Install the {oadp-short} Operator, the `DataProtectionApplication` CR, and its secret on the target cluster.
1818
* Create an S3-compatible storage solution and a ready-to-use bucket with proper credentials configured. For more information, see "Installing and configuring the {oadp-short} Operator with {ztp}".
19+
* The `openshift-adp` namespace for the OADP `ConfigMap` object must exist on all managed clusters and the hub for the OADP `ConfigMap` to be generated and copied to the clusters.
1920
2021
.Procedure
2122

@@ -29,20 +30,20 @@ Prepare your {oadp-short} resources to restore your application after an upgrade
2930
│ │ ├── ImageBasedUpgrade.yaml
3031
│ │ ├── PlatformBackupRestore.yaml
3132
│ │ ├── PlatformBackupRestoreLvms.yaml
33+
│ │ ├── PlatformBackupRestoreWithIBGU.yaml
3234
├── ...
33-
├── ibu-upgrade-ranGen.yaml
3435
├── kustomization.yaml
3536
----
3637

37-
[IMPORTANT]
38-
====
39-
The `kustomization.yaml` file must be located in the same directory structure as previously shown to reference the `ibu-upgrade-ranGen.yaml` manifest.
40-
====
38+
The `source-crs/ibu/PlatformBackupRestoreWithIBGU.yaml` file is provided in the ZTP container image.
4139

42-
The `source-crs/ibu/PlatformBackupRestore.yaml` file is provided in the ZTP container image.
40+
.PlatformBackupRestoreWithIBGU.yaml
41+
include::snippets/ibu-PlatformBackupRestoreWithIBGU.adoc[]
4342

44-
.PlatformBackupRestore.yaml
45-
include::snippets/ibu-PlatformBackupRestore.adoc[]
43+
[NOTE]
44+
====
45+
If you perform the image-based upgrade directly on managed clusters, use the `PlatformBackupRestore.yaml` file.
46+
====
4647

4748
If you use {lvms} to create persistent volumes, you can use the `source-crs/ibu/PlatformBackupRestoreLvms.yaml` provided in the ZTP container image to back up your {lvms} resources.
4849

@@ -72,65 +73,24 @@ The same version of the applications must function on both the current and the t
7273
====
7374
--
7475

75-
. Create the `oadp-cm` `ConfigMap` object through the `oadp-cm-policy` in a new `PolicyGenTemplate` called `ibu-upgrade-ranGen.yaml`:
76-
+
77-
[source,yaml]
78-
----
79-
apiVersion: ran.openshift.io/v1
80-
kind: PolicyGenTemplate
81-
metadata:
82-
name: example-group-ibu
83-
namespace: "ztp-group"
84-
spec:
85-
bindingRules:
86-
group-du-sno: ""
87-
mcp: "master"
88-
evaluationInterval:
89-
compliant: 10s
90-
noncompliant: 10s
91-
sourceFiles:
92-
- fileName: ConfigMapGeneric.yaml
93-
complianceType: mustonlyhave
94-
policyName: "oadp-cm-policy"
95-
metadata:
96-
name: oadp-cm
97-
namespace: openshift-adp
98-
----
99-
10076
. Create a `kustomization.yaml` with the following content:
10177
+
10278
[source,yaml]
10379
----
10480
apiVersion: kustomize.config.k8s.io/v1beta1
10581
kind: Kustomization
10682

107-
generators: <1>
108-
- ibu-upgrade-ranGen.yaml
109-
110-
configMapGenerator: <2>
83+
configMapGenerator: # <1>
11184
- files:
112-
- source-crs/ibu/PlatformBackupRestore.yaml
85+
- source-crs/ibu/PlatformBackupRestoreWithIBGU.yaml
11386
#- source-crs/custom-crs/ApplicationClusterScopedBackupRestore.yaml
11487
#- source-crs/custom-crs/ApplicationApplicationBackupRestoreLso.yaml
11588
name: oadp-cm
116-
namespace: ztp-group
89+
namespace: openshift-adp # <2>
11790
generatorOptions:
118-
disableNameSuffixHash: true
119-
120-
121-
patches: <3>
122-
- target:
123-
group: policy.open-cluster-management.io
124-
version: v1
125-
kind: Policy
126-
name: example-group-ibu-oadp-cm-policy
127-
patch: |-
128-
- op: replace
129-
path: /spec/policy-templates/0/objectDefinition/spec/object-templates/0/objectDefinition/data
130-
value: '{{hub copyConfigMapData "ztp-group" "oadp-cm" hub}}'
91+
disableNameSuffixHash: true
13192
----
132-
<1> Generates the `oadp-cm-policy`.
133-
<2> Creates the `oadp-cm` `ConfigMap` object on the hub cluster with `Backup` and `Restore` CRs.
134-
<3> Overrides the data field of `ConfigMap` added in `oadp-cm-policy`. A hub template is used to propagate the `oadp-cm` `ConfigMap` to all target clusters.
93+
<1> Creates the `oadp-cm` `ConfigMap` object on the hub cluster with `Backup` and `Restore` CRs.
94+
<2> The namespace must exist on all managed clusters and the hub for the OADP `ConfigMap` to be generated and copied to the clusters.
13595

13696
. Push the changes to your Git repository.
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// Module included in the following assemblies:
2+
// * edge_computing/image-based-upgrade/ztp-image-based-upgrade.adoc
3+
4+
:_mod-docs-content-type: CONCEPT
5+
[id="ztp-image-based-upgrade-procedure-cancel_{context}"]
6+
= Canceling an image-based upgrade on managed clusters at scale
7+
8+
You can cancel the upgrade on a set of managed clusters that completed the `Prep` stage.
9+
10+
include::snippets/ibu-supported-action-combinations.adoc[]
11+
12+
.Prerequisites
13+
14+
* You have logged in to the hub cluster as a user with `cluster-admin` privileges.
15+
16+
.Procedure
17+
18+
. Create a separate YAML file on the hub cluster that contains the `ImageBasedGroupUpgrade` CR:
19+
+
20+
[source,yaml]
21+
----
22+
apiVersion: lcm.openshift.io/v1alpha1
23+
kind: ImageBasedGroupUpgrade
24+
metadata:
25+
name: <filename>
26+
namespace: default
27+
spec:
28+
clusterLabelSelectors:
29+
- matchExpressions:
30+
- key: name
31+
operator: In
32+
values:
33+
- spoke4
34+
ibuSpec:
35+
seedImageRef:
36+
image: quay.io/seed/image:4.16.0-rc.1
37+
version: 4.16.0-rc.1
38+
pullSecretRef:
39+
name: "<seed_pull_secret>"
40+
extraManifests:
41+
- name: example-extra-manifests
42+
namespace: openshift-lifecycle-agent
43+
oadpContent:
44+
- name: oadp-cm
45+
namespace: openshift-adp
46+
plan:
47+
- actions: ["Abort"]
48+
rolloutStrategy:
49+
maxConcurrency: 5
50+
timeout: 10
51+
----
52+
+
53+
All managed clusters that completed the `Prep` stage are moved back to the `Idle` stage.
54+
55+
. Apply the created file by running the following command on the hub cluster:
56+
+
57+
[source,terminal]
58+
----
59+
$ oc apply -f <filename>.yaml
60+
----
61+
62+
.Verification
63+
64+
* Monitor the status updates by running the following command:
65+
+
66+
[source,terminal]
67+
----
68+
$ oc get ibgu -o yaml
69+
----
70+
71+
+
72+
.Example output
73+
[source,yaml]
74+
----
75+
# ...
76+
status:
77+
clusters:
78+
- completedActions:
79+
- action: Prep
80+
currentActions:
81+
- action: Abort
82+
name: spoke4
83+
# ...
84+
----
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// Module included in the following assemblies:
2+
// * edge_computing/image-based-upgrade/ztp-image-based-upgrade.adoc
3+
4+
:_mod-docs-content-type: CONCEPT
5+
[id="ztp-image-based-upgrade-procedure-one-step_{context}"]
6+
= Performing an image-based upgrade on managed clusters at scale in one step
7+
8+
For use cases when service interruption is not a concern, you can upgrade a set of your managed clusters by using the `ImageBasedGroupUpgrade` CR with several actions combined in one step with one rollout strategy.
9+
With one rollout strategy, the upgrade time can be reduced but you can only troubleshoot failed clusters after the upgrade plan is complete.
10+
11+
.Prerequisites
12+
13+
* You have logged in to the hub cluster as a user with `cluster-admin` privileges.
14+
* You have created policies and `ConfigMap` objects for resources used in the image-based upgrade.
15+
* You have installed the {lcao} and OADP Operators on all managed clusters through the hub cluster.
16+
17+
.Procedure
18+
19+
. Create a YAML file on the hub cluster that contains the `ImageBasedGroupUpgrade` CR:
20+
+
21+
--
22+
include::snippets/ibu-ImageBasedGroupUpgrade.adoc[]
23+
--
24+
25+
. Apply the created file by running the following command on the hub cluster:
26+
+
27+
[source,terminal]
28+
----
29+
$ oc apply -f <filename>.yaml
30+
----
31+
32+
.Verification
33+
34+
* Monitor the status updates by running the following command:
35+
+
36+
--
37+
[source,terminal]
38+
----
39+
$ oc get ibgu -o yaml
40+
----
41+
42+
.Example output
43+
[source,yaml]
44+
----
45+
# ...
46+
status:
47+
clusters:
48+
- completedActions:
49+
- action: Prep
50+
failedActions:
51+
- action: Upgrade
52+
name: spoke1
53+
- completedActions:
54+
- action: Prep
55+
- action: Upgrade
56+
- action: FinalizeUpgrade
57+
name: spoke4
58+
- failedActions:
59+
- action: Prep
60+
name: spoke6
61+
# ...
62+
----
63+
--

0 commit comments

Comments
 (0)