14.6.3. Image prune conditions
OpenShift Container Platform supports two methodologies for pruning images:
- Pruning by age and tag
- Pruning by size limit
These methodologies are mutually exclusive. You must choose whether to prune by age and tag, or by size limit. Regardless of the method that you choose, the image pruner checks to ensure that images in use are not removed.
An image is only pruned if it meets the primary condition and is not actively referenced by a system component.
14.6.3.1. Pruning an image by age and tag 링크 복사링크가 클립보드에 복사되었습니다!
Pruning an image by age and tag is the default pruning strategy. It identifies images for removal by using the --keep-younger-than and --keep-tag-revisions flags. To prune an image by age and tag, the image must be older than the --keep-younger-than threshold, not one of the most recent tag revisions, and cannot be in use by an active workload.
For an image to be pruned by age and tag, all of the following conditions must be met:
-
The image is managed by OpenShift Container Platform or has the
openshift.io/image.managedannotation. -
The image is older than the time specified by the
--keep-younger-thanflag. -
The image is not one of the most recent images for its tag, as specified by the
--keep-tag-revisionsflag. The image is not currently referenced by any of the following active or recent API objects:
-
Pods or image streams created more recently than the
--keep-younger-thanduration. - Running or pending pods
- Deployments, replication controllers, replica sets, or stateful sets.
- Builds, build configurations, jobs, or cronjobs.
-
Pods or image streams created more recently than the
An image is only removed if it is old, not a recent tag revision, and is confirmed to have no active references by system components.