-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image name/tag resolution preprocessing pass #1697
Comments
Note that pulling by image id may not be supported by Docker: moby/moby#4106. We could help push/implement that feature, and/or we could potentially work around it by adding a new unique tag to the image. |
How does this interact with PullPolicy?
|
@erictune Excellent question! Current policies are Really only PullNever and PullIfNotPresent are useful if one binds to a specific version, though PullAlways would still work -- ideally Docker should realize it doesn't actually need to pull in that case. I don't expect everyone to use this pass. People who don't care about predictable deployments and rollbacks probably wouldn't use it, for instance, and would just use a combination of PullPolicy and version tags (e.g., |
We could also do image name validation. Currently, pods just stay in Waiting forever and the user has to look at Docker logs to figure this out. This was discussed in #1088, but we should just validate image names as early as possible. |
We're working on getting pull be immutable id into the next version of the registry. |
Presentation on our internal package manager: |
Greetings, just today I committed support for obtaining the image digest from the V2 Registry: https://github.com/shaded-enmity/docker-doug/tree/distv2 It's as simple as:
A quick introduction into libdoug / doug-cli:
My original plan was to have 'hooks' or 'triggers' into K8s to issue a configuration change when new version of an image was available, but after seeing this issue and #1743 I think that the scope of libdoug fits very well into the requirements:
It's written in Python, but I could rewrite it in Go should that be a problem for integration. |
distribution/distribution#387 was merged yesterday, providing a Go client for 2.0 registries. We could vendor it in and use it directly, or if that's not desirable, we could provide a contrib example that uses the distribution code to get the digest for a specific repo and tag. |
Also, see #7203 for information about rkt image identifiers, and the differences between how rkt and Docker identify images. |
OpenShift 3.6 implements an admission controller that automatically replaces image tags with digests if the image matches a known construct. I believe weaveworks Flux also has mechanisms for this at config time. With initializers, it should now be possible to resolve images in replicasets to digests automatically, and that may be a good candidate for a simple example of how initializers can be used. |
I've been thinking the image "stream" could be specified by an annotation initially and, eventually, a field. One issue is that access to the image pull secrets is needed. |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
/remove-lifecycle stale |
While designing webhooks / apply we've actually had in mind the case where a mutating admission webhook resolves the image tag and swaps in the digest. Unfortunately, to get the right rollback behavior I think you'd have to resolve when the template is submitted and not when the pod is created (so on all of deployment, statefulset, daemonset, ... create/update). Anyway I don't think there's anything stopping someone from making an image resolver cluster plugin. |
(Which is to say, I'm not 100% sure it will work, but I'd be interested in seeing the results if someone tries.) |
Another example solution: That would be great as a kubectl plugin. |
https://github.com/google/k8s-digester also offers this either as an admission controller or a client-side kpt function. |
…erry-pick-1694-to-release-4.11 [release-4.11] OCPBUGS-18843: UPSTREAM: <carry>: Force using host go always and use host libriaries
As discussed in #1007, #1694, #1132, and elsewhere, Docker image names/tags are not immutable. If one wants a repeatable deployment, predictable rollbacks, etc., they need to be resolved at deployment time and recorded. I expect rollbacks to be driven off of version-controlled configuration data, which means they need to be processed on the client side or returned to the client. I propose a self-contained pre-processing program to do this, to fit into the build-oriented approach proposed in #1694.
The original names/tags should be recorded in the pod as annotations.
The text was updated successfully, but these errors were encountered: