docker container is Kubernetes cluster can't access outer resources

1/11/2018

I am rather new to Kubernetes and I am trying to start a kubernetes cluster and deploy some pods .

I have a image I want to build in order to perfrom a deployment of it so I am trying to build it's dockerfile but one of the steps in the dockerfile tries to access golobal resource : curl --silent --location https://rpm.nodesource.com/setup_7.x

I keep getting this error message : Connecting to rpm.nodesource.com (rpm.nodesource.com)|13.32.153.164|:443... failed: Connection timed out. Connecting to rpm.nodesource.com (rpm.nodesource.com)|2600:9000:2116:2800:16:cdcc:51c0:93a1|:443... failed: Network is unreachable

I can see that container was able to resolve the dns name ( based on the IP it prints out in the message ) but is unable to access it.

my /etc/resolv.conf is : search default.svc.cluster.local svc.cluster.local nameserver 10.82.67.3 nameserver 10.233.0.3 nameserver 8.8.8.8 options ndots:2 timeout:2 attempts:2

my docker version is 17.05.0-ce my OS is redhat 7.4

this is the Network part of the docker inpect command of the container :

"NetworkSettings": {
            "Bridge": "",
            "SandboxID": "a4a4c93d0ea19b48b84ef8556678f458405b32238542ede30a78229f82b55a12",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {},
            "SandboxKey": "/var/run/docker/netns/a4a4c93d0ea1",
            "SecondaryIPAddresses": null,
            "SecondaryIPv6Addresses": null,
            "EndpointID": "66d74579ee50bc8289dfc58235188e262ebf707f2f0ae0ccb640524e6e9d3f22",
            "Gateway": "172.17.0.1",
            "GlobalIPv6Address": "",
            "GlobalIPv6PrefixLen": 0,
            "IPAddress": "172.17.0.2",
            "IPPrefixLen": 16,
            "IPv6Gateway": "",
            "MacAddress": "02:42:ac:11:00:02",
            "Networks": {
                "bridge": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": null,
                    "NetworkID": "655da32f8ecab7a4bba100594a1e242c60b27304e9937ae5192857942b661603",
                    "EndpointID": "66d74579ee50bc8289dfc58235188e262ebf707f2f0ae0ccb640524e6e9d3f22",
                    "Gateway": "172.17.0.1",
                    "IPAddress": "172.17.0.2",
                    "IPPrefixLen": 16,
                    "IPv6Gateway": "",
                    "GlobalIPv6Address": "",
                    "GlobalIPv6PrefixLen": 0,
                    "MacAddress": "02:42:ac:11:00:02"
                }
            }
        }

any help would be appriciated

-- eran meiri
docker
kubernetes

0 Answers