-
Notifications
You must be signed in to change notification settings - Fork 462
Mirrors support #805
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
Mirrors support #805
Conversation
|
This is totally fine but it'd also be nice to update the PR description with at least a sentence or two for what the end goal is - think of it like the "seed" upon which an eventual proper commit message could grow 😄 - offhand I'm guessing something like:
|
Updated now. Still WIP, notably I really don’t know much about what I’m doing, any pointers would be appreciated. Specific questions, for now:
|
fdeab41 to
f1dbcf9
Compare
|
/retest |
1 similar comment
|
/retest |
|
This work is targeted at 4.2 right? Can you link to any more information on the dependent crio work? It looks like this depends on openshift/api#354 - may be good to do a separate PR to update our vendored openshift/api as a prep step. |
5287e23 to
21ebcdd
Compare
Yes.
cri-o/cri-o#2494 + cri-o/cri-o#2510 for 1.14,
Will do, at least to get the other effects of |
#936 . This PR now includes code from that branch, so don’t merge it as it is; after #936 is merged, I’ll rebase on top of master again. |
|
/retest |
Update both the templates and updateRegistriesConfig. Also add tests for updateRegistriesConfig; the existing tests only test that the controller makes the right kinds of API calls, but does not check the content at all. Signed-off-by: Miloslav Trmač <[email protected]>
… registry configuration This is not currently necessary because such configurations are not created by the code, but it will be useful momentarily, after mirror configuration is added. Signed-off-by: Miloslav Trmač <[email protected]>
This should not change behavior in most cases, because the kubelet is already reading that file for credentials whenever the user does not provide any others. It matters only for mirrors (configured using ImageContentSourcePolicy), which are transparent to the kubelet. Because any users without credentials were already able to use the kubelet's config.json secrets, this should not give unprivileged users any more rights than they have had previously. (In addition, only cluster administrators can configure mirrors.) Signed-off-by: Miloslav Trmač <[email protected]>
…erRole Signed-off-by: Miloslav Trmač <[email protected]>
... to make the update visible (in both), and to actually apply the created update at all (in TestImageConfigUpdate). Signed-off-by: Miloslav Trmač <[email protected]>
Signed-off-by: Miloslav Trmač <[email protected]>
|
Dropping the WIP marker, reportedly this works, and the new behavior now has tests at least as good as any other aspect of the controller (in particular, the tests now actually verify expected contents of the generated Still, I don’t yet fully understand the test scaffolding, so, please, make sure to review that the “Fix TestContainerRuntimeConfigUpdate and TestImageConfigUpdate” commit makes sense. |
|
@mtrmac: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
|
/retest |
|
Tested this out on a cluster and everything works fine. Tried out adding multiple ImageContentSourcePolicy objects with overlaps in the mirrors defined. Tested deleting the CRs one by one and registries.conf was populates as expected. And it plays well with any insecure and blocked registries added to the cluster wide Image CR. |
I thought exactly that path, in particular the Line 627 in aed3d2a
OTOH, I can’t get |
|
@mtrmac ah yes, that should do it. I missed it, my bad. |
|
@runcom @cgwalters tests are green! |
|
this LGTM will let walters/runcom give the final approval |
Hmm...not as of #827 right? |
The above is not talking about non-container users with local accounts on the node, but about users of the cluster with the ability to create pods (who should, typically, have no access outside of their containers at all). For such users, the kubelet automatically uses the kubelet’s secret file if the user does not explicitly provide a pull secret (and the kubelet is, before this PR, the only process on the node that actually needs access to the cluster pull secret file), and sends the credentials to CRI-O to cause the image to be pulled. |
|
/approve |
|
So...this is a lot to take in. I'd like to see a higher level design doc if one exists. But the feature is critical, and I think we can learn more after it lands in master. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cgwalters, mtrmac The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
+1 |
- What I did
Implemented support for
operator/v1alpha1.ImageContentSourcePolicy, added by openshift/api#354 , to support multiple mirrors for pulling OpenShift images.NOTE: The CRI interface does not support passing more than one set of credentials for pulling an image, i.e. the pull secret, if any, only applies to the primary image location (the one explicitly included in the pull spec). If any of the mirrors need credentials, the credentials must be available on the node, probably via
ControllerConfig.spec.pullSecret. That implies that configuring per-tenant credentials for accessing the mirrors is not currently possible.To make this work at least for the OpenShift images, this PR also hard-codes CRI-O’s
global_auth_fileoption to point to the pull secret file also used by kubelet, which provides access to OpenShift mirrors.- How to verify it
WIP. There are fairly extensive unit tests, but I didn’t try this end-to end yet at all.
- Description for the changelog
(Depending on which variant is chosen):
operator/v1alpha1.ImageContentSourcePolicy, allowing to configure mirrors for image registries