Ugly Command Party - Day 8
Shea Stewart
Technologist working in Platform & Customer Engineering Capacities @ RunWhen
On the 8th of the ugly command party, the command I'll share is:
Ugly Command Name: List ImagePullBackOff Events and Test Path and Tags
What does it do?
This command will:
When would you use it?
Often enough we run into a scenario where a container is stuck in ImagePullBackOff because someone has migrated container image registry paths, or removed a tag. In other scenarios, your cluster may simply be having an issue reaching the registry. This little oneliner can help you gain some visibility from the context of the cluster - and of course you can modify the skopeo commands to provide more insight as needed.
What is the command?
Please view the GitHub Gist below to find the code snippet. Due to a limitation with LinkedIn, it does not accept some code in the code snippet and breaks the Article feature :-/
What is some sample output?
领英推荐
Found BackOff with message: "Back-off pulling image \"ghcr.io/runwhen-contrib/runwhen-local:failed\"
Checking if we can reach the image with skopeo and what tags exist
time="2023-07-13T03:08:05Z" level=fatal msg="Error parsing image name \"docker://ghcr.io/runwhen-contrib/runwhen-local:failed\": reading manifest failed in ghcr.io/runwhen-contrib/runwhen-local: manifest unknown"
command terminated with exit code 1
Container image 'ghcr.io/runwhen-contrib/runwhen-local:failed' does not exist.
Available tags for 'ghcr.io/runwhen-contrib/runwhen-local':
{
? ? "Repository": "ghcr.io/runwhen-contrib/runwhen-local",
? ? "Tags": [
? ? ? ? "main-35e9b27b",
? ? ? ? "latest",
? ? ? ? "main-9f5b4927",
? ? ? ? "main-5642b231",
? ? ? ? "main-08dfe243",
? ? ? ? "main-046c5471",
? ? ? ? "main-a31c6d0b",
? ? ? ? "main-4bd9fe96",
? ? ? ? "main-e6aa2111",
? ? ? ? "main-1ae13298",
? ? ? ? "main-88582f9d"
...
]
}
What does it need?
If you want this command tailored for your environment and ready to copy & paste, this command has been added to the open source library of commands available through RunWhen Local. Check it out here: https://docs.runwhen.com/public/runwhen-local/getting-started/running-locally
Find an example of the command here: https://runwhen-local.sandbox.runwhen.com/argo/argo-Image-Check/#list-images-and-tags-for-every-container-in-failed-pods
Have an ugly command to share? Collaborate with us on GitHub with issues or discussions
This is part of a series.?Check out?this article?to see additional ugly commands posted in the series.