I am using create_namespaced_pod()
of the kubernetes-client
package to dynamically create kubernetes pods from docker images that are in an images registry.
How do I check if the Docker image exists in the registry before calling create_namespaced_pod()
? I want to avoid creating the pod and then having to deal with error messages.
you may use docker registry ls
to list the contents of your registry and parse for your image specifically. if ls
isn't working for you, you can try a simple HTTP call to the image's URL in the registry, and check the response code.