5

I have a basic OpenShift origin cluster started with oc cluster up

Now, in the default 'MyProject' i wanted to build a source from git repo and it's failing with the error Could not resolve host: github.com; Name or service not known

Even I tried setting up gogs and migrate the public hosted source code on github.com to gogs pod but throwing same error.

Kindly advise if there are any additional network settings required during OpenShift cluster setup in order to access github.com or any other public domains. I can sense it's a network issue but not sure what exactly needs to be configured on the cluster.

Shoaib Khan
  • 899
  • 14
  • 26
  • What operating system are you using? This can be caused by firewall rules blocking local use of port for DNS. The ``oc cluster up`` command will want to try and use that port, but if system blocks it, you get what you see. – Graham Dumpleton Jan 07 '17 at 21:43
  • Am on macOS Sierra 10.12.1 Would you mind throwing some light on how do I go about unblocking firewall rules around it? to my surprise i'm able to add docker images which is ofcourse being pulled from public domains but not able to access github inside a pod. – Shoaib Khan Jan 07 '17 at 21:45
  • Do you have ``socat`` installed? Are you using Apple firewall from System Preferences or some other like Little Snitch? – Graham Dumpleton Jan 07 '17 at 21:54
  • Yes I have socat installed. Never changed any firewall settings so it must be default. – Shoaib Khan Jan 07 '17 at 21:56
  • Go into System Preferences. Under Security & Privacy -> Firewall see if the firewall is enabled. – Graham Dumpleton Jan 07 '17 at 21:58
  • Firewall: Off under Security & Privacy -> Firewall – Shoaib Khan Jan 07 '17 at 22:01
  • Are you running any existing DNS software on port 53 of your system? Was there any message when ``oc cluster up`` was started about it not being able to use port 53 and instead using port 8053? – Graham Dumpleton Jan 07 '17 at 22:04
  • No it started without any error/warning. Shall I share the oc cluster up output? – Shoaib Khan Jan 07 '17 at 22:05
  • I have seen this issue on Fedora but can't remember for sure if have seen it on MacOS X or not. Since the firewall doesn't appear to be blocking it, if you are confident you aren't already running something on DNS port, bring you problem to the users list at http://lists.openshift.redhat.com/openshiftmm/listinfo where you will find folks who may have a better idea. – Graham Dumpleton Jan 08 '17 at 04:47

3 Answers3

3

I know this is an old ticket, but I came across this issue when looking for a solution for my problem. I had exactly the same problem as described in this issue. For me, the problem lies within the combination between Ubuntu 18.04 and docker. I followed solution B from this answer.
Hopefully this helps someone as I've lost a lot of time trying to resolve this issue by looking for the problem as if it was a problem from openshift/okd while the actual cause lies within the combination between docker and ubuntu (at least for me).

Bob Claerhout
  • 781
  • 5
  • 24
1

You can edit the config Map of Node in master server ( In order to provide proper information of your nameserver to the pods.)

# oc get cm -n openshift-node

for all compute nodes edit the config map by below command.( Only need to perform in master server)

#  oc edit cm node-config-compute  -n openshift-node

......
dnsBindAddress: 127.0.0.1:53
    dnsDomain: cluster.local
    dnsIP: 10.0.80.11
    dnsNameservers: null
    dnsRecursiveResolvConf: /etc/origin/node/resolv.conf
.......

Edit dnsIP section with your DNS IP. Then restart the service

# systemctl restart atomic-openshift-node.service

The DNS ip will be prepended in all /etc/resolv.conf file of Pods.

Click for detail info

0

Shutdown the cluster with: oc cluster down

Edit the file: openshift.local.clusterup/node/node-config.yml and set dnsIP: "" to 8.8.8.8 Edit the file openshift.local.clusterup/kubedns/resolv.conf

and add

nameserver 8.8.8.8
nameserver 8.8.4.4

Also make sure you have the DNS options inside the docker config file

Edit /etc/docker/daemon.json and add

"dns": ["8.8.8.8", "8.8.4.4"]

Then start your cluster with

oc cluster up

and now it should work fine.

Charith Jayasanka
  • 4,033
  • 31
  • 42