-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
ImageStream pull on external private docker registry #17238
Comments
Thank you @zonArt for the report. Do I understand you reproducer correctly that importing image from the registry without |
@miminar Exactly |
Unfortunately I could not reproduce locally. I can import from a secured registry requiring authentication just fine:
Is your private registry behind some load balancer/proxy? |
Used version:
Lowering priority. |
@miminar Yes the registry is behing an nginx reverse proxy, the registry is hosted on JFrog Artifactory and I'm using the On strange thing I notice is that as you put |
@zonArt it would be awesome if you could provide the nginx' configuration. The |
Here you are:
|
I thought I could reproduce just by putting nginx in front of upstream registry running locally on my host, but I failed. It still works for me. My nginx configuration is attached below.
The import happens from inside a VM:
I guess I will need to start playing with artifactory in order to reproduce. Suggestions to complicate this setup for an error to occur are welcome. For most common setups, the import-image seems to do the job though. |
@miminar Thanks for trying to help me understand what's not working with my setup. I'm not sure adding nginx in front of your registry really changes something especially when looking at your The main reason of the nginx/apache reverse proxy in front of Artifactory is to be able to handle multiple private registry on Artifactory (that's why the |
I'm pretty sure the request goes through the nginx proxy. The So it seems the only option left to reproduce the issue is to start using artifactory. But before I do, could you please try to catch headers between nginx and master using wireshark/tcpdump or similar? You may need to switch to insecure connection first. |
Hi, sorry I'm quite busy during these two weeks won't have much time to provide you with the data you asked for. I'll try to get them as soon as I'm back next Monday. Thanks for your help |
we have the same problem with our registrie |
@helletheone can you elaborate? Do you use artifactory as well? |
is maybe the problem the --docker-email ? is the field for any use? because we dont use the email for login |
@zonArt thanks for pointing in the right direction! the docker email shouldn't be the problem. we're using artifactory with the reverse proxy method "sub domain" which results in the following url's:
we had to define two secrets in openshift - one for getting the manifest infos from artifactory through the "artifactory-url" and a second one for actually pulling the image from the docker-registry-url (also linked to the serviceaccount default)
i would expect, that with the reverse proxy method "port" you have to define the two secrets the same way, just with different ports - once with the port your artifactory instance is listening (443) and the other one with the port of the registry you defined in the setup of the local repository.
@miminar
maybe it would be even better to define the secret for the manifest infos a little bit more strict. e.g. artifactory.example.com:443/artifactory/api/docker/test instead of just artifactory.example.com:443 for just matching this registry. |
@mhofstetter thank you for the detailed report. This needs to be fixed together with #9730. |
@mhofstetter Thanks for this very well detailed explanation. I'll check if I have the same (but obviously I would say it's similar). Anyway, it really helped me a lot understand (and accept) why both secret are needed. |
Hello. I am using Artifactory behind Nginx as well and I have the same issue, except that adding :443 doesn't change anything. Here is what I did: DOCKER_CREDENTIALS="`
--docker-username=...
--docker-password=...
--docker-email=...
"
oc secrets new-dockercfg docker-n7lab-io \
--docker-server=docker.n7lab.io \
${DOCKER_CREDENTIALS}
oc secrets new-dockercfg artifactory-n7lab-io \
--docker-server=artifactory.n7lab.io \
${DOCKER_CREDENTIALS}
oc secrets new-dockercfg docker-n7lab-io-443 \
--docker-server=docker.n7lab.io:443 \
${DOCKER_CREDENTIALS}
oc secrets new-dockercfg artifactory-n7lab-io-443 \
--docker-server=artifactory.n7lab.io:443 \
${DOCKER_CREDENTIALS}
# Lets link them all together to show that none of this works ;)
ACCOUNTS=(default builder deployer)
IMAGES=(docker-n7lab-io docker-n7lab-io-443 artifactory-n7lab-io artifactory-n7lab-io-443)
for A in "${ACCOUNTS[@]}"; do
for I in "${IMAGES[@]}"; do
echo "${A} ${I}"
oc secrets link "${A}" "${I}"
done
done Now when I do oc import-image my-hello --from=docker.n7lab.io/n7lab/hello --confirm or oc import-image my-hello-443 --from=docker.n7lab.io:443/n7lab/hello --confirm I get an error message:
On the servcer, I get two requests: In the openshift logs, i get a
in both cases. |
@miminar is this covered by https://trello.com/c/o8tqoSAp ? If not, should it be? (should that card be extended to cover this) |
@bparees it definitely should be. (I've already referenced the issue in the card). |
part of https://trello.com/c/o8tqoSAp |
Impossible to use secret when trying to pull/push image from an external private docker registry with ImageStream
Version
oc v3.6.0+c4dd4cf
kubernetes v1.6.1+5115d708d7
features: Basic-Auth GSSAPI Kerberos SPNEGO
Server https://openshift.example.com:8443
openshift v3.6.0+c4dd4cf
kubernetes v1.6.1+5115d708d7
Steps To Reproduce
--docker-server=my-private-registry.example.com
(and of course relevant user credential)oc import-image myimage --from=my-private-registry.example.com/myimage --confirm
Current Result
Fails with:
error: tag latest failed: you may not have access to the Docker image "my-private-registry.example.com/myimage"
Expected Result
Everything should work, tags should be retrieved so should the images in the registry
Additional Information
Solution can be to add an additional secret with the port (443) and correct ImageStream's
--from
by also adding the port (443). This leads to some inconsistency on how to pull/push an image and looks like a regression as stated in following comment:#9584 (comment)
The text was updated successfully, but these errors were encountered: