# Kubernetes Pod can't ping external IP

**URL:** <https://discuss.kubernetes.io/t/kubernetes-pod-cant-ping-external-ip/12496>\
**Category:** General Discussions\
**Created:** [August 20, 2020, 11:38am UTC](https://discuss.kubernetes.io/t/kubernetes-pod-cant-ping-external-ip/12496 "2020-08-20T11:38:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev-winnersek](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@dev-winnersek](https://discuss.kubernetes.io/u/dev-winnersek)\
**Post date:** [August 20, 2020, 11:38am UTC](https://discuss.kubernetes.io/t/kubernetes-pod-cant-ping-external-ip/12496/1 "2020-08-20T11:38:32Z")

</div>

Informations :  
Version of Kubernetes : 2.19.0  
Installations done :  
- Kubectl : 1.18.5-00  
- Kubelet : 1.18.5-00  
- Kubeadm: 1.18.5-00

```
Number of node: one node master 

```

Dns resolver: core-dns deployment  
Network Kubernetes: calico deployment

Hi everybody. I have installed Kubernetes cluster using kubelet, kubeadm and Kubectl. I have installed prometheus using Helm inside my kubernetes cluster on the node master (IP: 192.168.40.39) and create service of type NodePort to access prometheus. Now i want prometheus to access metrics on another host machine of ip 192.168.40.35 (there is no kubernetes on this machine). I have noticed this :  
- Prometheus can’t access metrics on external host ip (example of 192.168.40.35 )  
- Prometheus can access metrics on the node master (192.168.40.39)  
- I can’t ping external host inside all Kubernetes pods (i try ping with 192.168.40.35 on different pods)

My question is how can i allow a specific pod to communicate with an external ip address ?

---

<div class="post-metadata">

**Author:** ![tej-singh-rana](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/tej-singh-rana/32/5921_2.png) [@tej-singh-rana](https://discuss.kubernetes.io/u/tej-singh-rana)\
**Post date:** [August 21, 2020, 11:35am UTC](https://discuss.kubernetes.io/t/kubernetes-pod-cant-ping-external-ip/12496/2 "2020-08-21T11:35:44Z")

</div>

Hello, dev-winnersek  
You can use nodePort service type.

> **[Service](https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types)**
>
> An abstract way to expose an application running on a set of PodsA Pod represents a set of running containers in your cluster. as a network service.
> With Kubernetes you don't need to modify your application to use an unfamiliar service discovery...

---

<div class="post-metadata">

**Author:** ![dev-winnersek](https://avatars.discourse-cdn.com/v4/letter/d/919ad9/32.png) [@dev-winnersek](https://discuss.kubernetes.io/u/dev-winnersek)\
**Post date:** [August 21, 2020, 11:50am UTC](https://discuss.kubernetes.io/t/kubernetes-pod-cant-ping-external-ip/12496/3 "2020-08-21T11:50:05Z")

</div>

Thanks @tej-singh-rana for you reply. I have created my Prometheus service with NodePort. The problem i have is that inside prometheus pod (on master node), i can’t ping external ip address on the same network as the node master.  
Node master ip: 192.168.40.39  
I execute prometheus pod  
Inside prometheus pod, i ping 192.168.40.35. It doesn’t work. So i can’t monitor external host with my prometheus server that is on the node master.

---

<div class="post-metadata">

**Author:** ![thockin](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/thockin/32/2457_2.png) [@thockin](https://discuss.kubernetes.io/u/thockin)\
**Post date:** [August 21, 2020, 3:56pm UTC](https://discuss.kubernetes.io/t/kubernetes-pod-cant-ping-external-ip/12496/4 "2020-08-21T15:56:42Z")

</div>

[https://speakerdeck.com/thockin/bringing-traffic-into-your-kubernetes-cluster](https://speakerdeck.com/thockin/bringing-traffic-into-your-kubernetes-cluster)

[https://speakerdeck.com/thockin/kubernetes-and-networks-why-is-this-so-dang-hard](https://speakerdeck.com/thockin/kubernetes-and-networks-why-is-this-so-dang-hard)

Do these help?
