-
Notifications
You must be signed in to change notification settings - Fork 62
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
Feature: Support gitea as internal registry #398
Comments
Questions: Are we sure that changes documented here https://cnoe.io/docs/reference-implementation/installations/idpbuilder/how-it-works#in-cluster-dns-configuration and coded using such a template https://github.com/cnoe-io/idpbuilder/blob/main/pkg/build/templates/coredns/cm-coredns-default.yaml.tmpl#L6-L13 work ? Could it be possible that when a DNS request is issued by a pod running inside the cluster that it gets first the
If I log the requests issued against coreDNS, this is what I got when buildah push the image (and uses coreDNS to resolve the hostname)
If I deploy the pod within the same namespace as
Looking to the log of the CoreDNS pod don't help as requests are issued but we don' t know which IP is finally or not returned to the issuer :-( |
I'm becoming mad as all the tests that I'm doing work using: ping, curl, dig executed part of a pod created using dnsutils tool : kubectl apply -f https://k8s.io/examples/admin/dns/dnsutils.yaml 1. Test using DIG (OK)CoreDNS log
DIG
2. Test using curl (OK)CoreDNS
Curl
3. Test using pingCoreDNS
Ping (OK)
|
To fix my issue, this is I what I hard coded as coreDNS rewrite rules.
|
Hmm this shouldn't be necessary because anything under We are also building an example of using the gitea registry and it does seem to work. Your dig, curl, and ping tests all show things are working. It's possible buildah is using its own way of resolving names. |
I don't think so. As Such a problem will certainly occur with other Ideally we should try to better match the incoming DNS requests as here that fails with buildah. Unfortunately the
|
Is this the address that's being queried? That does not look right to me. Queries should be made for |
No .The address which is requested by buildah is Here is the buildah log
The address queried |
No |
This didn't work for me to get to the failure point you mentioned: https://github.com/ch007m/idpbuilder-gitea-issue/tree/main It hangs at maven step and couldn't proceed. No logs or anything provided. I just tested with buildah in k8s cluster and it does work for me:
outside cluster:
|
Did you created a pod within the idpbuilder cluster to test the commands you mentioned ? |
I will create a new pipeline using simply your test case to reproduce the error. |
I can reproduce the error using the default configMap of CoreDNS. The pod (created by a Tekton task) can
and coreDNS logs such information
The Buildah pod created also by a tekton task fails
and coredns log reports
|
@cmoulliard Can you test this for me? I tested with fedora image. I think there's an additional security feature that's causing this issue.
# curl https://argocd.cnoe.localtest.me
curl: (6) Could not resolve host: argocd.cnoe.localtest.me
# # curl https://cnoe.localtest.me
curl: (60) SSL certificate problem: self-signed certificate
More details here: https://curl.se/docs/sslcerts.html So http request against # dig argocd.cnoe.localtest.me
;; QUESTION SECTION:
;argocd.cnoe.localtest.me. IN A
;; ANSWER SECTION:
ingress-nginx-controller.ingress-nginx.svc.cluster.local. 30 IN A 10.96.148.124
# dig cnoe.localtest.me
;; QUESTION SECTION:
;cnoe.localtest.me. IN A
;; ANSWER SECTION:
cnoe.localtest.me. 30 IN A 10.96.148.124 The difference is the answer response. Apparently exact match in coredns returns the answer section as requested while regex match is up to users. See: https://coredns.io/plugins/rewrite/#response-rewrites Some distributions like Fedora are apparently very sensitive to this. To resolve this, try updating the coredns config like so:
The Once updated, wait for it to propagate. About 30 seconds.
|
I was exactly thinking about that as I read somewhere that some CLI check also the answer to be sure that there is no man in the middle attack. I will make a test tomorrow. Many thanks for your feedback |
I did a new test successfully this morning
using as rewrite rules
Will you or should I submit a PR ? |
PR by you would be great :) |
…e answer response to avoid man in the middle attack. cnoe-io#398 Signed-off-by: cmoulliard <[email protected]>
Have you searched for this feature request?
Problem Statement
Description
To build/push an image against the gitea registry, the way to go is to use the ingress-nginx address resolved against the localhost
127.0.0.1
. While this approach is fine when users will build/push an image outside of the k8s cluster, that will fail using the internal k8s service of gitea as you can see hereafter the error reported doing in a pod abuildah build
of a dockerfilePossible Solution
I suggest that we support such an option. That will require that we do different things such as:
https://github.com/cnoe-io/idpbuilder/blob/main/pkg/kind/resources/kind.yaml.tmpl
to include the internal address of the registryAlternatives Considered
No response
The text was updated successfully, but these errors were encountered: