-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OSDOCS-12183: adding how to delete manifests
- Loading branch information
Showing
4 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
microshift_running_apps/microshift-deleting-resource-manifests.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
:_mod-docs-content-type: ASSEMBLY | ||
[id="microshift-deleting-resource-manifests"] | ||
= Deleting resource manifests | ||
include::_attributes/attributes-microshift.adoc[] | ||
:context: microshift-deleting-resource-manifests | ||
|
||
toc::[] | ||
|
||
{microshift-short} supports the deletion of resource manifests for the following use cases: | ||
|
||
* Data removal - when you need to completely remove a resource from the cluster. | ||
* Upgrade - during an upgrade, some resources may need to be removed while others are retained to preserve data. | ||
Deleting resource manifests manages the cluster resources efficiently by removing outdated objects while and retaining necessary data. | ||
|
||
include::modules/microshift-examples-of-usecase.adoc[leveloffset=+1] | ||
|
||
include::modules/microshift-manifests-deletion-overview.adoc[leveloffset=+1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Module included in the following assemblies: | ||
// | ||
// * microshift//running_applications/microshift-deleting-resource-manifests.adoc | ||
|
||
:_mod-docs-content-type: PROCEDURE | ||
[id="microshift-examples-of-usecase_{context}"] | ||
= Use cases for resource manifest deletion | ||
|
||
The following explains the use case in which the resource manifest deletion is used. | ||
|
||
== Data removal scenario | ||
Use the following procedure in the data removal scenario to completely delete the resource defined in the kustomize manifest file. | ||
|
||
.Procedure | ||
|
||
. Identify the file that needs to be placed in the `delete` subdirectories. | ||
. Move the manifest file into one of the `delete` subdirectories under the configured manifests directory by running the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
[sudo] mv /usr/lib/microshift/manifests.d/some-user-manifest /usr/lib/microshift/manifests.d/delete/some-user-manifest | ||
---- | ||
. {microshift-short} detects and removes the resource after the manifest file is placed in the `delete` subdirectories. | ||
|
||
|
||
== Upgrade scenario | ||
Use the following procedure in the upgrade scenario where some resources need to be removed while retaining others to preserve data. | ||
|
||
.Procedure | ||
|
||
. Identify the manifest file that requires updating. It is not necessary to include the entire resource `spec` in the `delete` subdirectories. | ||
. Specify the metadata, such as `name` and `namespace` of the resource to be removed, in the `delete` subdirectories. | ||
. {microshift-short} detects and removes the specified object without affecting related data. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Module included in the following assemblies: | ||
// | ||
// * microshift//running_applications/microshift-deleting-resource-manifests.adoc | ||
|
||
:_mod-docs-content-type: PROCEDURE | ||
[id="microshift-manifests-deletion-overview_{context}"] | ||
= How manifest deletion works | ||
|
||
By default, {microshift-short} expects to find deletion manifests in the `delete` subdirectories within the manifest path. When a manifest file is placed in these subdirectories, {microshift-short} automatically handles the removal. Read through the following procedure to understand how manifest file deletion works in {microshift-short}. | ||
|
||
.Procedure | ||
|
||
. At every start, before applying the manifests, {microshift-short} scans the following `delete` sub directories within the configured manifests directory to identify the Kustomize manifest files that need to be deleted: | ||
|
||
* /usr/lib/microshift/manifests/delete | ||
* /usr/lib/microshift/manifests.d/delete/* | ||
* /etc/microshift/manifests/delete | ||
* /etc/microshift/manifests.d/delete/* | ||
. {microshift-short} deletes the resources defined in the kustomize manifest file found in the `delete` directories by running the following command. | ||
+ | ||
[source,terminal] | ||
---- | ||
kubectl delete -k --ignore-not-found=true | ||
---- |