1

I am learning Kubernetes, by following the course, https://www.udemy.com/course/kubernetes-microservices/

When i try to build an image, using the file https://github.com/fleetman-ci-cd-demo/jenkins, using minikube's docker daemon. it fails due to the below reason

curl: (6) Could not resolve host: updates.jenkins.io

I logged into minikube shell as well and did a ping, it didn't work

    ping updates.jenkins.io
    PING updates.jenkins.io (52.202.51.185): 56 data bytes
    --- updates.jenkins.io ping statistics ---
68 packets transmitted, 0 packets received, 100% packet loss

I am able to reach google.com from minikube shell.

Please let me know how can i fix this?

The build log

    WARN: install-plugins.sh is deprecated, please switch to jenkins-plugin-cli
Creating initial locks...
Analyzing war /usr/share/jenkins/jenkins.war...
Registering preinstalled plugins...
curl: (6) Could not resolve host: updates.jenkins.io
The command '/bin/sh -c /usr/local/bin/install-plugins.sh workflow-aggregator &&     /usr/local/bin/install-plugins.sh github &&     /usr/local/bin/install-plugins.sh ws-cleanup &&     /usr/local/bin/install-plugins.sh greenballs &&     /usr/local/bin/install-plugins.sh simple-theme-plugin &&     /usr/local/bin/install-plugins.sh kubernetes &&     /usr/local/bin/install-plugins.sh docker-workflow &&     /usr/local/bin/install-plugins.sh kubernetes-cli &&     /usr/local/bin/install-plugins.sh github-branch-source' returned a non-zero code: 6
Umar
  • 1,002
  • 3
  • 12
  • 29
  • Do you need to set a proxy to get out? – Ian W Aug 31 '21 at 04:52
  • I can see the `coredns` pod running in minikube – Umar Sep 01 '21 at 01:39
  • @Umar Have you managed this to work? If not, that looks like `dns` issue since `curl code 6` means that it wasn't able to resolve the host name. Please dns follow troubleshooting steps [described here - kubernetes official documentation](https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/). Let me know what you find. – moonkotte Sep 02 '21 at 07:47
  • 1
    Fixed it by changing the VM, https://stackoverflow.com/questions/67488003/how-to-resolve-dns-lookup-error-when-trying-to-run-example-microservice-applicat – Umar Sep 04 '21 at 16:07

2 Answers2

2

I think it's the container that has an issue with connecting to the Internet. I ran into the same problem with Jenkins running in Docker.

I restarted Docker with sudo service docker restart, and solved my problem.

Now if you're concerned with the depracated warning:

WARN: install-plugins.sh is deprecated, please switch to jenkins-plugin-cli

You may refer to Jenkins' Docker image guide. Cut to the chase, you need to replace the RUN command in Dockerfile. From something like:

RUN /usr/local/bin/install-plugins.sh < /usr/share/jenkins/ref/plugins.txt

to:

RUN jenkins-plugin-cli -f /usr/share/jenkins/ref/plugins.txt

Even with jenkins-plugin-cli, I faced a similar problem of reaching to Jenkins plugin server. It shows

Error getting update center json

In my case, it was solved by the same method, just restarting Docker service.

Tennom
  • 21
  • 1
  • I fixed this by using docker as my virtual machine instead of virtual box based on this link. https://stackoverflow.com/questions/67488003/how-to-resolve-dns-lookup-error-when-trying-to-run-example-microservice-applicat https://github.com/kubernetes/minikube/issues/10830 – Umar Sep 04 '21 at 16:06
0

Try with curl command , some website disable the ping for security reasons

Quentin Merlin
  • 664
  • 1
  • 6
  • 31
  • Able to access the website using curl. But why the docker build is failing with `returned a non-zero code: 6`. How do i fix that? – Umar Sep 01 '21 at 01:38