Skip to content

Commit 5330a11

Browse files
authored
Merge pull request #83246 from aravipra/OSDOCS-12183
OSDOCS-12183: adding how to delete manifests
2 parents 260ce45 + f095eb7 commit 5330a11

7 files changed

+145
-0
lines changed

_topic_maps/_topic_map_ms.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ Distros: microshift
195195
Topics:
196196
- Name: Using Kustomize to deploy applications
197197
File: microshift-applications
198+
- Name: Deleting resource manifests
199+
File: microshift-deleting-resource-manifests
198200
- Name: Embedding applications on RHEL for Edge
199201
File: microshift-embedded-apps-on-rhel-edge
200202
- Name: Embedding applications for offline use
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="microshift-deleting-resource-manifests"]
3+
= Deleting resource manifests
4+
include::_attributes/attributes-microshift.adoc[]
5+
:context: microshift-deleting-resource-manifests
6+
7+
toc::[]
8+
9+
{microshift-short} supports the deletion of resource manifests in the following situations:
10+
11+
* Manifest removal: Manifests can be removed when you need to completely remove a resource from the cluster.
12+
* Manifest upgrade: During an application upgrade, some resources might need to be removed while others are retained to preserve data.
13+
14+
When creating new manifests, you can use resource manifest deletion to remove or update old objects, ensuring there are no conflicts or issues.
15+
16+
[IMPORTANT]
17+
====
18+
Manifest files placed in the `delete` subdirectories are not automatically removed and require manual deletion.
19+
====
20+
21+
include::modules/microshift-manifests-deletion-overview.adoc[leveloffset=+1]
22+
23+
[id="microshift-examples-of-usecase_{context}"]
24+
== Use cases for resource manifest deletion
25+
26+
The following explains the use case in which the resource manifest deletion is used.
27+
28+
include::modules/microshift-manifests-removal-scenario-rpm.adoc[leveloffset=+2]
29+
30+
include::modules/microshift-manifests-removal-scenario-ostree.adoc[leveloffset=+2]
31+
32+
include::modules/microshift-manifests-upgrade-scenario-rpm.adoc[leveloffset=+2]
33+
34+
include::modules/microshift-manifests-upgrade-scenario-ostree.adoc[leveloffset=+2]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * microshift//running_applications/microshift-deleting-resource-manifests.adoc
4+
5+
:_mod-docs-content-type: CONCEPT
6+
[id="microshift-manifests-deletion-overview_{context}"]
7+
= How manifest deletion works
8+
9+
By default, {microshift-short} searches for deletion manifests in the `delete` subdirectories within the manifests path. When a user places a manifest in these subdirectories, {microshift-short} removes the manifests when the system is started. Read through the following to understand how manifests deletion works in {microshift-short}.
10+
11+
. Each time the system starts, before applying the manifests, {microshift-short} scans the following `delete` subdirectories within the configured manifests directory to identify the Kustomize manifests that need to be deleted:
12+
13+
* /usr/lib/microshift/manifests/delete
14+
* /usr/lib/microshift/manifests.d/delete/*
15+
* /etc/microshift/manifests/delete
16+
* /etc/microshift/manifests.d/delete/*
17+
18+
. {microshift-short} deletes the resources defined in the Kustomize manifests found in the `delete` directories by running the equivalent of the `kubectl delete --ignore-not-found -k` command.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * microshift/running_applications/microshift-deleting-resource-manifests.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="microshift-manifests-removal-scenario-ostree_{context}"]
7+
= Removing manifests for OSTree systems
8+
9+
Use the following procedure to completely delete the resource defined in the Kustomize manifests.
10+
11+
[IMPORTANT]
12+
====
13+
For OSTree installation, the `delete` subdirectories are read only.
14+
====
15+
16+
.Procedure
17+
18+
. Identify the manifest that needs to be placed in the `delete` subdirectories.
19+
. Package the manifest into an RPM. See link:https://docs.redhat.com/en/documentation/red_hat_build_of_microshift/{ocp-version}/html/running_applications/microshift-embedding-apps-tutorial#microshift-building-apps-rpms_microshift-embedding-apps-tutorial[Building the RPM package for the application] for the procedure to package the manifest into an RPM.
20+
. Add the packaged RPM to the blueprint file to install it into correct location. See link:https://docs.redhat.com/en/documentation/red_hat_build_of_microshift/{ocp-version}/html/running_applications/microshift-embedding-apps-tutorial#microshift-adding-app-rpms-to-blueprint_microshift-embedding-apps-tutorial[Adding application RPMs to a blueprint] for the procedure to add an RPM to a blueprint.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * microshift//running_applications/microshift-deleting-resource-manifests.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="microshift-manifests-removal-scenario-rpm_{context}"]
7+
= Removing manifests for RPM systems
8+
9+
Use the following procedure in the data removal scenario for RPM systems to completely delete the resource defined in the Kustomize manifests.
10+
11+
.Procedure
12+
13+
. Identify the manifest that needs to be placed in the `delete` subdirectories.
14+
. Create the `delete` subdirectory in which the manifest will be placed by running the following command:
15+
+
16+
[source,terminal]
17+
----
18+
$ sudo mkdir -p _<path_of_delete_directory>_ <1>
19+
----
20+
<1> Replace `_<path_of_delete_directory>_` with the path of the delete subdirectory, for example, `/etc/microshift/manifests.d/delete`, `/etc/microshift/manifests/delete/`, `/usr/lib/microshift/manifests.d/delete` or `/usr/lib/microshift/manifests/delete`.
21+
. Move the manifest file into one of the `delete` subdirectories under the configured manifests directory by running the following command:
22+
+
23+
[source,terminal]
24+
----
25+
$ [sudo] mv _<path_of_manifests>_ _<path_of_delete_directory>_ <1>
26+
----
27+
<1> Replace `_<path_of_manifests>_` with the path of the manifest to be deleted, for example, `/etc/microshift/manifests.d/010-SOME-MANIFEST`. Replace `_<path_of_delete_directory>_` with the path of the delete subdirectory, for example, `/etc/microshift/manifests.d/delete`, `/etc/microshift/manifests/delete`, `/usr/lib/microshift/manifests.d/delete` or `/usr/lib/microshift/manifests/delete`.
28+
. Restart {microshift-short} by running the following command:
29+
+
30+
[source,terminal]
31+
----
32+
$ sudo systemctl restart microshift
33+
----
34+
. {microshift-short} detects and removes the resource after the manifest file is placed in the `delete` subdirectories.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * microshift/running_applications/microshift-deleting-resource-manifests.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="microshift-manifests-upgrade-scenario-ostree_{context}"]
7+
= Upgrading manifests for OSTree systems
8+
9+
Use the following procedure to remove some resources while retaining others to preserve data.
10+
11+
[IMPORTANT]
12+
====
13+
For OSTree systems, the `delete` subdirectories are read only.
14+
====
15+
16+
.Procedure
17+
18+
. Identify the manifest that needs updating.
19+
. Create a new manifest to apply in the manifest path. See link:https://docs.redhat.com/en/documentation/red_hat_build_of_microshift/{ocp-version}/html/running_applications/applications-with-microshift#microshift-applying-manifests-example_applications-microshift[Using manifests example] to create new manifests using the example.
20+
. Create a new manifest for resource deletion to be placed in the `delete` subdirectories.
21+
. Use the procedure in "Removing manifests for OSTree systems" to remove the manifests.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * microshift/running_applications/microshift-deleting-resource-manifests.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="microshift-manifests-upgrade-scenario-rpm_{context}"]
7+
= Upgrading manifests for RPM systems
8+
9+
Use the following procedure to remove some resources while retaining others to preserve data.
10+
11+
.Procedure
12+
13+
. Identify the manifest that requires updating.
14+
. Create new manifests to be applied in the manifest path.
15+
. Create new manifests for resource deletion. It is not necessary to include the `spec` in these manifests. See link:https://docs.redhat.com/en/documentation/red_hat_build_of_microshift/{ocp-version}/html/running_applications/applications-with-microshift#microshift-applying-manifests-example_applications-microshift[Using manifests example] to create new manifests using the example.
16+
. Use the procedure in "Removing manifests for RPM systems" to create `delete` subdirectories and place the manifests created for resource deletion in this path.

0 commit comments

Comments
 (0)