Skip to content

hamza-labs/docker-registry-cleanup-k8s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 

Repository files navigation

Table of Contents

What Problems to solve

  • This tool help you to clean-up your private docker-registry by selecting unused images in kubernetes.

Useful command lines

kubectl get pods --all-namespaces -o jsonpath="{..image}" |\
                                                     tr -s '[[:space:]]' '\n' |\
                                                     cut -d "/" -f2,3 | sort -u >> /tmp/k8s/k8s.images
your_docker_registry_client list tags $your_repo --registry=your_registry_url | sort -u >> /tmp/your_docker_registry_name/dr.images

your_docker_registry_client delete $your_repo $your_reference --registry=your_registry_url | sort -u >> /tmp/your_docker_registry_name/dr.images

Sources

About

How can you cleanup your private docker registry unused images in k8s

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published