Minikube - unable to access updates.jenkins.io

8/31/2021

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
docker
jenkins
kubernetes
minikube

2 Answers

8/31/2021

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

-- Quentin Merlin
Source: StackOverflow

9/3/2021

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
Source: StackOverflow