Jenkins (running in Kubernetes) can't resolve Git repository

5/23/2019

I have an instance of Jenkins running in a pod in Kubernetes. I'm trying to let it connect to a local network git repository server, but I'm getting the error:

stdout: 
stderr: ssh: Could not resolve hostname {hostname}: Temporary failure in name resolution 
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I added a private key to Jenkins because I thought that authentication was the problem, but that didn't help. I also tried getting a shell into the Jenkins pod and I pinged the {hostname} but then I get the same error Temporary failure in name resolution. If I enter the IP address directly, the ping does work. But when I enter that IP address in Jenkins instead of the {hostname}, then I get a Connection timed out error..

I'm surely missing something, but I don't know what. When I first connected to the repo (from a local machine) I had to accept a server key first, otherwise the connection failed too. Could this be the problem, maybe?

-- Brontosaurs
dns
git
jenkins
kubernetes

0 Answers