이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 2. Deleting or updating Kustomize manifest resources


MicroShift supports the deletion of manifest resources in the following situations:

  • Manifest removal: Manifests can be removed when you need to completely remove a resource from the cluster.
  • Manifest upgrade: During an application upgrade, some resources might need to be removed while others are retained to preserve data.

When creating new manifests, you can use manifest resource deletion to remove or update old objects, ensuring there are no conflicts or issues.

Important

Manifest files placed in the delete subdirectories are not automatically removed and require manual deletion. Only the resources listed in the manifest files placed in the delete subdirectories are deleted.

2.1. How manifest deletion works

By default, MicroShift searches for deletion manifests in the delete subdirectories within the manifests path. When a user places a manifest in these subdirectories, MicroShift removes the manifests when the system is started. Read through the following to understand how manifests deletion works in MicroShift.

  1. Each time the system starts, before applying the manifests, MicroShift scans the following delete subdirectories within the configured manifests directory to identify the manifests 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/*
  2. MicroShift deletes the resources defined in the manifests found in the delete directories by running the equivalent of the kubectl delete --ignore-not-found -k command.

2.2. Use cases for manifest resource deletion

The following sections explain the use case in which the manifest resource deletion is used.

2.2.1. Removing manifests for RPM systems

Use the following procedure in the data removal scenario for RPM systems to completely delete the resource defined in the manifests.

Procedure

  1. Identify the manifest that needs to be placed in the delete subdirectories.
  2. Create the delete subdirectory in which the manifest will be placed by running the following command:

    $ sudo mkdir -p <path_of_delete_directory> 1
    1
    Replace <path_of_delete_directory> with one of the following valid directory paths: /etc/microshift/manifests.d/delete, /etc/microshift/manifests/delete/, /usr/lib/microshift/manifests.d/delete, or /usr/lib/microshift/manifests/delete.
  3. Move the manifest file into one of the delete subdirectories under the configured manifests directory by running the following command:

    $ [sudo] mv <path_of_manifests> <path_of_delete_directory>

    where: <path_of_manifests>:: Specifies the path of the manifest to be deleted, for example /etc/microshift/manifests.d/010-SOME-MANIFEST. <path_of_delete_directory>:: Specifies one of the following valid directory paths: /etc/microshift/manifests.d/delete, /etc/microshift/manifests/delete, /usr/lib/microshift/manifests.d/delete or /usr/lib/microshift/manifests/delete.

  4. Restart MicroShift by running the following command:

    $ sudo systemctl restart microshift
  5. MicroShift detects and removes the resource after the manifest file is placed in the delete subdirectories.

2.2.2. Removing manifests for OSTree systems

Use the following procedure to completely delete the resource defined in the manifests.

Important

For OSTree installation, the delete subdirectories are read-only.

Procedure

  1. Identify the manifest that needs to be placed in the delete subdirectories.
  2. Package the manifest into an RPM. See Building the RPM package for the application for the procedure to package the manifest into an RPM.
  3. Add the packaged RPM to the blueprint file to install it into correct location. See Adding application RPMs to a blueprint for the procedure to add an RPM to a blueprint.

2.2.3. Upgrading manifests for RPM systems

Use the following procedure to remove some resources while retaining others to preserve data.

Procedure

  1. Identify the manifest that requires updating.
  2. Create new manifests to be applied in the manifest directories.
  3. Create new manifests for resource deletion. It is not necessary to include the spec in these manifests. See Using manifests example to create new manifests using the example.
  4. Use the procedure in "Removing manifests for RPM systems" to create delete subdirectories and place the manifests created for resource deletion in this path.

2.2.4. Upgrading manifests for OSTree systems

Use the following procedure to remove some resources while retaining others to preserve data.

Important

For OSTree systems, the delete subdirectories are read-only.

Procedure

  1. Identify the manifest that needs updating.
  2. Create a new manifest to apply in the manifest directories. See Using manifests example to create new manifests using the example.
  3. Create a new manifest for resource deletion to be placed in the delete subdirectories.
  4. Use the procedure in "Removing manifests for OSTree systems" to remove the manifests.

2.3. Additional resources

Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.