Remove unused rendered machine configs

You can remove unused rendered machine configs by using the oc adm prune renderedmachineconfigs command with the --confirm command, reducing disk space and performance issues.

If any rendered machine config is not deleted, the command output indicates which was not deleted and lists the reason for skipping the deletion.

Procedure
  1. Optional: List the rendered machine configs that you can remove automatically by running the following command. Any rendered machine config marked with the as it’s currently in use message in the command output cannot be removed.

    $ oc adm prune renderedmachineconfigs --pool-name=worker
    Example output
    Dry run enabled - no modifications will be made. Add --confirm to remove rendered machine configs.
    dry-run deleting rendered MachineConfig rendered-worker-f38bf61ced3c920cf5a29a200ed43243
    dry-run deleting MachineConfig rendered-worker-fc94397dc7c43808c7014683c208956e
    Skip dry-run deleting rendered MachineConfig rendered-worker-708c652868f7597eaa1e2622edc366ef as it's currently in use

    where:

    pool-name

    Optional: Specifies the machine config pool where you want to delete the machine configs from.

  2. Remove the unused rendered machine configs by running the following command. The command in the following procedure would delete the two oldest unused rendered machine configs in the worker machine config pool.

    $ oc adm prune renderedmachineconfigs --pool-name=worker --count=2 --confirm

    where:

    --count

    Optional: Specifies the maximum number of unused rendered machine configs you want to delete, starting with the oldest.

    --confirm

    Indicates that pruning should occur, instead of performing a dry-run.

    --pool-name

    Optional: Specifies the machine config pool from which you want to delete the machine. If not specified, all the pools are evaluated.

    Example output
    deleting rendered MachineConfig rendered-worker-f38bf61ced3c920cf5a29a200ed43243
    deleting rendered MachineConfig rendered-worker-fc94397dc7c43808c7014683c208956e
    Skip deleting rendered MachineConfig rendered-worker-708c652868f7597eaa1e2622edc366ef as it's currently in use