Skip to content

Commit 74bfe43

Browse files
committed
TELCODOCS-1707: Add Preparing/ConfigMap objects nonGitOps
1 parent f975a6f commit 74bfe43

11 files changed

+405
-3
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3103,8 +3103,8 @@ Topics:
31033103
File: cnf-image-based-upgrade-install-operators
31043104
- Name: Generating a seed image for the image-based upgrade with Lifecycle Agent
31053105
File: cnf-image-based-upgrade-generate-seed
3106-
# - Name: Creating ConfigMap objects for the image-based upgrade with Lifecycle Agent
3107-
# File: cnf-image-based-upgrade-prep-resources
3106+
- Name: Creating ConfigMap objects for the image-based upgrade with Lifecycle Agent
3107+
File: cnf-image-based-upgrade-prep-resources
31083108
# - Name: Creating ConfigMap objects for the image-based upgrade with Lifecycle Agent using GitOps ZTP
31093109
# File: ztp-image-based-upgrade-prep-resources
31103110
# - Name: Performing an image-based upgrade for single-node OpenShift clusters

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,4 @@ include::modules/ztp-image-based-upgrade-extra-manifests-guide.adoc[leveloffset=
127127
* xref:../../edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/ztp-image-based-upgrade-prep-resources.adoc#ztp-image-based-upgrade-creating-backup-resources-with-ztp_ztp-gitops[Creating ConfigMap objects for the image-based upgrade with GitOps ZTP]
128128
129129
* xref:../../backup_and_restore/application_backup_and_restore/installing/about-installing-oadp.adoc#about-installing-oadp[About installing OADP]
130-
////
130+
////
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="cnf-image-based-upgrade-prep-resources"]
3+
= Creating ConfigMap objects for the image-based upgrade with {lcao}
4+
include::_attributes/common-attributes.adoc[]
5+
:context: nongitops
6+
7+
toc::[]
8+
9+
The {lcao} needs all your OADP resources, extra manifests, and custom catalog sources wrapped in a `ConfigMap` object to process them for the image-based upgrade.
10+
11+
include::modules/cnf-image-based-upgrade-prep-oadp.adoc[leveloffset=+1]
12+
13+
include::modules/cnf-image-based-upgrade-prep-extramanifests.adoc[leveloffset=+1]
14+
15+
include::modules/cnf-image-based-upgrade-prep-catalogsource.adoc[leveloffset=+1]
16+
17+
////
18+
[role="_additional-resources"]
19+
.Additional resources
20+
21+
* xref:../../../edge_computing/image_based_upgrade/preparing_for_image_based_upgrade/cnf-image-based-upgrade-shared-container-image.adoc#cnf-image-based-upgrade-shared-varlibcontainers[Configuring a shared container directory for the image-based upgrade]
22+
23+
* xref:../../../backup_and_restore/application_backup_and_restore/installing/about-installing-oadp.adoc[About installing OADP]
24+
25+
* xref:../../../edge_computing/image_based_upgrade/cnf-image-based-upgrade-base.adoc#cnf-image-based-upgrade-for-sno[Performing an image-based upgrade with Lifecycle Agent]
26+
27+
* xref:../../../operators/understanding/olm/olm-understanding-olm.adoc#olm-catalogsource_olm-understanding-olm[Catalog source]
28+
////
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Module included in the following assemblies:
2+
// * edge_computing/image-based-upgrade/cnf-preparing-for-image-based-upgrade.adoc
3+
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="cnf-image-based-upgrade-creating-backup-custom-catalog-sources_{context}"]
6+
= Creating ConfigMap objects of custom catalog sources for the image-based upgrade with {lcao}
7+
8+
You can keep your custom catalog sources after the upgrade by generating a `ConfigMap` object for your catalog sources and adding them to the `spec.extraManifest` field in the `ImageBasedUpgrade` CR.
9+
For more information about catalog sources, see "Catalog source".
10+
11+
.Procedure
12+
13+
. Create a YAML file that contains the `CatalogSource` CR:
14+
+
15+
--
16+
[source,yaml]
17+
----
18+
apiVersion: operators.coreos.com/v1
19+
kind: CatalogSource
20+
metadata:
21+
name: example-catalogsources
22+
namespace: openshift-marketplace
23+
spec:
24+
sourceType: grpc
25+
displayName: disconnected-redhat-operators
26+
image: quay.io/example-org/example-catalog:v1
27+
----
28+
--
29+
30+
. Create the `ConfigMap` object by running the following command:
31+
+
32+
[source,terminal]
33+
----
34+
$ oc create configmap example-catalogsources-cm --from-file=example-catalogsources.yaml=<path_to_catalogsource_cr> -n openshift-lifecycle-agent
35+
----
36+
37+
. Patch the `ImageBasedUpgrade` CR by running the following command:
38+
+
39+
[source,terminal]
40+
----
41+
$ oc patch imagebasedupgrades.lca.openshift.io upgrade \
42+
-p='{"spec": {"extraManifests": [{"name": "example-catalogsources-cm", "namespace": "openshift-lifecycle-agent"}]}}' \
43+
--type=merge -n openshift-lifecycle-agent
44+
----
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
2+
// Module included in the following assemblies:
3+
// * edge_computing/image-based-upgrade/cnf-preparing-for-image-based-upgrade.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="cnf-image-based-upgrade-creating-backup-extra-manifests_{context}"]
7+
= Creating ConfigMap objects of extra manifests for the image-based upgrade with {lcao}
8+
9+
You can create additional manifests that you want to apply to the target cluster.
10+
11+
.Procedure
12+
13+
. Create a YAML file that contains your extra manifests:
14+
+
15+
[source,yaml]
16+
----
17+
apiVersion: sriovnetwork.openshift.io/v1
18+
kind: SriovNetworkNodePolicy
19+
metadata:
20+
name: "pci-sriov-net-e5l"
21+
namespace: openshift-sriov-network-operator
22+
spec:
23+
deviceType: vfio-pci
24+
isRdma: false
25+
nicSelector:
26+
pfNames: [ens1f0]
27+
nodeSelector:
28+
node-role.kubernetes.io/master: ""
29+
mtu: 1500
30+
numVfs: 8
31+
priority: 99
32+
resourceName: pci_sriov_net_e5l
33+
---
34+
apiVersion: sriovnetwork.openshift.io/v1
35+
kind: SriovNetwork
36+
metadata:
37+
name: "networking-e5l"
38+
namespace: openshift-sriov-network-operator
39+
spec:
40+
ipam: |-
41+
{
42+
}
43+
linkState: auto
44+
networkNamespace: sriov-namespace
45+
resourceName: pci_sriov_net_e5l
46+
spoofChk: "on"
47+
trust: "off"
48+
----
49+
50+
. Create the `ConfigMap` object by running the following command:
51+
+
52+
[source,terminal]
53+
----
54+
$ oc create configmap example-extra-manifests-cm --from-file=example-extra-manifests.yaml=<path_to_extramanifest> -n openshift-lifecycle-agent
55+
----
56+
57+
. Patch the `ImageBasedUpgrade` CR by running the following command:
58+
+
59+
[source,terminal]
60+
----
61+
$ oc patch imagebasedupgrades.lca.openshift.io upgrade \
62+
-p='{"spec": {"extraManifests": [{"name": "example-extra-manifests-cm", "namespace": "openshift-lifecycle-agent"}]}}' \
63+
--type=merge -n openshift-lifecycle-agent
64+
----
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
// Module included in the following assemblies:
2+
// * edge_computing/image-based-upgrade/cnf-preparing-for-image-based-upgrade.adoc
3+
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="cnf-image-based-upgrade-creating-backup-oadp-resources_{context}"]
6+
= Creating OADP ConfigMap objects for the image-based upgrade with {lcao}
7+
8+
Create your OADP resources that are used to back up and restore your resources during the upgrade.
9+
10+
.Prerequisites
11+
12+
* Generate a seed image from a compatible seed cluster.
13+
* Create OADP backup and restore resources.
14+
* Create a separate partition on the target cluster for the container images that is shared between stateroots. For more information about, see "Configuring a shared container directory for the image-based upgrade".
15+
* Deploy a version of {lcao} that is compatible with the version used with the seed image.
16+
* Install the OADP Operator, the `DataProtectionApplication` CR, and its secret on the target cluster.
17+
* Create an S3-compatible storage solution and a ready-to-use bucket with proper credentials configured. For more information, see "About installing OADP".
18+
19+
.Procedure
20+
21+
. Create the OADP `Backup` and `Restore` CRs for platform artifacts in the same namespace where the OADP Operator is installed, which is `openshift-adp`.
22+
23+
.. If the target cluster is managed by {rh-rhacm}, add the following YAML file for backing up and restoring {rh-rhacm} artifacts:
24+
+
25+
--
26+
.PlatformBackupRestore.yaml for {rh-rhacm}
27+
include::snippets/ibu-PlatformBackupRestore.adoc[]
28+
--
29+
30+
.. If you created persistent volumes on your cluster through {lvms}, add the following YAML file for {lvms} artifacts:
31+
+
32+
.PlatformBackupRestoreLvms.yaml for {lvms}
33+
include::snippets/ibu-PlatformBackupRestoreLvms.adoc[]
34+
35+
. (Optional) If you need to restore applications after the upgrade, create the OADP `Backup` and `Restore` CRs for your application in the `openshift-adp` namespace.
36+
37+
.. Create the OADP CRs for cluster-scoped application artifacts in the `openshift-adp` namespace.
38+
+
39+
.Example OADP CRs for cluster-scoped application artifacts for LSO and {LVMS}
40+
include::snippets/ibu-ApplicationClusterScopedBackupRestore.adoc[]
41+
42+
.. Create the OADP CRs for your namespace-scoped application artifacts.
43+
+
44+
--
45+
.Example OADP CRs namespace-scoped application artifacts when LSO is used
46+
include::snippets/ibu-ApplicationBackupRestoreLso.adoc[]
47+
48+
.Example OADP CRs namespace-scoped application artifacts when {lvms} is used
49+
include::snippets/ibu-ApplicationBackupRestoreLvms.adoc[]
50+
51+
[IMPORTANT]
52+
====
53+
The same version of the applications must function on both the current and the target release of {product-title}.
54+
====
55+
--
56+
57+
. Create the `ConfigMap` object for your OADP CRs by running the following command:
58+
+
59+
[source,terminal]
60+
----
61+
$ oc create configmap oadp-cm-example --from-file=example-oadp-resources.yaml=<path_to_oadp_crs> -n openshift-adp
62+
----
63+
64+
. Patch the `ImageBasedUpgrade` CR by running the following command:
65+
+
66+
[source,terminal]
67+
----
68+
$ oc patch imagebasedupgrades.lca.openshift.io upgrade \
69+
-p='{"spec": {"oadpContent": [{"name": "oadp-cm-example", "namespace": "openshift-adp"}]}}' \
70+
--type=merge -n openshift-lifecycle-agent
71+
----
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[source,yaml]
2+
----
3+
apiVersion: velero.io/v1
4+
kind: Backup
5+
metadata:
6+
labels:
7+
velero.io/storage-location: default
8+
name: backup-app
9+
namespace: openshift-adp
10+
spec:
11+
includedNamespaces:
12+
- test
13+
includedNamespaceScopedResources:
14+
- secrets
15+
- persistentvolumeclaims
16+
- deployments
17+
- statefulsets
18+
- configmaps
19+
- cronjobs
20+
- services
21+
- job
22+
- poddisruptionbudgets
23+
- <application_custom_resources> <1>
24+
excludedClusterScopedResources:
25+
- persistentVolumes
26+
---
27+
apiVersion: velero.io/v1
28+
kind: Restore
29+
metadata:
30+
name: test-app
31+
namespace: openshift-adp
32+
labels:
33+
velero.io/storage-location: default
34+
annotations:
35+
lca.openshift.io/apply-wave: "4"
36+
spec:
37+
backupName:
38+
backup-app
39+
----
40+
<1> Define custom resources for your application.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
[source,yaml]
2+
----
3+
apiVersion: velero.io/v1
4+
kind: Backup
5+
metadata:
6+
labels:
7+
velero.io/storage-location: default
8+
name: backup-app
9+
namespace: openshift-adp
10+
spec:
11+
includedNamespaces:
12+
- test
13+
includedNamespaceScopedResources:
14+
- secrets
15+
- persistentvolumeclaims
16+
- deployments
17+
- statefulsets
18+
- configmaps
19+
- cronjobs
20+
- services
21+
- job
22+
- poddisruptionbudgets
23+
- <application_custom_resources> <1>
24+
includedClusterScopedResources:
25+
- persistentVolumes <2>
26+
- logicalvolumes.topolvm.io <3>
27+
- volumesnapshotcontents <4>
28+
---
29+
apiVersion: velero.io/v1
30+
kind: Restore
31+
metadata:
32+
name: test-app
33+
namespace: openshift-adp
34+
labels:
35+
velero.io/storage-location: default
36+
annotations:
37+
lca.openshift.io/apply-wave: "4"
38+
spec:
39+
backupName:
40+
backup-app
41+
restorePVs: true
42+
restoreStatus:
43+
includedResources:
44+
- logicalvolumes <5>
45+
----
46+
<1> Define custom resources for your application.
47+
<2> Required field.
48+
<3> Required field
49+
<4> Optional if you use {lvms} volume snapshots.
50+
<5> Required field.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[source,yaml]
2+
----
3+
apiVersion: velero.io/v1
4+
kind: Backup
5+
metadata:
6+
annotations:
7+
lca.openshift.io/apply-label: "apiextensions.k8s.io/v1/customresourcedefinitions/test.example.com,security.openshift.io/v1/securitycontextconstraints/test,rbac.authorization.k8s.io/v1/clusterroles/test-role,rbac.authorization.k8s.io/v1/clusterrolebindings/system:openshift:scc:test" <1>
8+
name: backup-app-cluster-resources
9+
labels:
10+
velero.io/storage-location: default
11+
namespace: openshift-adp
12+
spec:
13+
includedClusterScopedResources:
14+
- customresourcedefinitions
15+
- securitycontextconstraints
16+
- clusterrolebindings
17+
- clusterroles
18+
excludedClusterScopedResources:
19+
- Namespace
20+
---
21+
apiVersion: velero.io/v1
22+
kind: Restore
23+
metadata:
24+
name: test-app-cluster-resources
25+
namespace: openshift-adp
26+
labels:
27+
velero.io/storage-location: default
28+
annotations:
29+
lca.openshift.io/apply-wave: "3" <2>
30+
spec:
31+
backupName:
32+
backup-app-cluster-resources
33+
----
34+
<1> Replace the example resource name with your actual resources.
35+
<2> The `lca.openshift.io/apply-wave` value must be higher than the value in the platform `Restore` CRs and lower than the value in the application namespace-scoped `Restore` CR.

0 commit comments

Comments
 (0)