OpenFaaS with internal Docker registry on KinD failure

82 Views Asked by At

I'm trying to run OpenFaaS CE on KinD cluster where the Docker registry is also part of the cluster but running the functions fails because the internal registry is unreachable.

OpenFaaS was installed using a Helm chart and uses two namespaces:

  1. openfaas (for the control plane)
  2. openfaas-fn (for the functions)

In order to push an adequate function I had to expose port 5000 to the host, create an /etc/hosts record with the internal name of the Docker registry (docker-registry-1702201453.default.svc.cluster.local). Then I had to build, push and deploy accordingly, when trying to run the function it remains in Not Ready state and the K8s logs show the following messages:

Error: ImagePullBackOff
Error: ErrImagePull
Failed to pull image "docker-registry-1702201453.default.svc.cluster.local:5000/figlet2:latest": rpc error: code = Unknown desc = failed to pull and unpack image "docker-registry-1702201453.default.svc.cluster.local:5000/figlet2:latest": failed to resolve reference "docker-registry-1702201453.default.svc.cluster.local:5000/figlet2:latest": failed to do request: Head "https://docker-registry-1702201453.default.svc.cluster.local:5000/v2/figlet2/manifests/latest": dial tcp: lookup docker-registry-1702201453.default.svc.cluster.local: no such host

I thought it might be CoreDNS related so I started doing all sorts of manipulations (adding static records etc.) when I finally realized I need to use the name with the numbers at the end.

I added a curl function and sent a request to my Docker registry: it worked.

I couldn't find a way to exec into the faas-netes (nats) Docker nor the Queue Worker so I can't simply run an nslookup directly from these services. What am I missing?

0

There are 0 best solutions below