Unable to ping one service to another service in Kubernetes cluster?










1















I have created a local ubuntu Kubernetes cluster, having 1 master and 2 slave nodes.



I deployed 2 applications in 2 pods and created service for both of the pods, it's working fine.
I entered inside pod by typing this command ,



$ kubectl exec -it firstpod /bin/bash
# apt-get update


Unable to make update and I'm getting an error:



Err http://security.debian.org jessie/updates InRelease

Err http://deb.debian.org jessie InRelease

Err http://deb.debian.org jessie-updates InRelease

Err http://security.debian.org jessie/updates Release.gpg Temporary failure resolving 'security.debian.org' Err http://deb.debian.org jessie-backports InRelease

Err http://deb.debian.org jessie Release.gpg Temporary failure resolving 'deb.debian.org' Err http://deb.debian.org jessie-updates Release.gpg Temporary failure resolving 'deb.debian.org' Err http://deb.debian.org jessie-backports Release.gpg Temporary failure resolving 'deb.debian.org' Reading package lists... Done W: Failed to fetch http://deb.debian.org/debian/dists/jessie/InRelease

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/InRelease

W: Failed to fetch http://security.debian.org/dists/jessie/updates/InRelease

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-backports/InRelease

W: Failed to fetch http://security.debian.org/dists/jessie/updates/Release.gpg Temporary failure resolving 'security.debian.org'

W: Failed to fetch http://deb.debian.org/debian/dists/jessie/Release.gpg Temporary failure resolving 'deb.debian.org'

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/Release.gpg Temporary failure resolving 'deb.debian.org'

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-backports/Release.gpg Temporary failure resolving 'deb.debian.org'

W: Some index files failed to download. They have been ignored, or old ones used instead.


I'm trying to ping my second pod service:



# ping secondservice (This is the service name of secondpod)
PING secondservice.default.svc.cluster.local (10.100.190.196): 56 data bytes
unable to ping.


How can I ping/call the second service from the first node?










share|improve this question



















  • 2





    Did you install pod network (calico/flannel.. etc) in your cluster? Also can you please check the kube-proxy pod's log?

    – hoque
    Nov 16 '18 at 6:23











  • Looks like you don't have any network...

    – Rico
    Nov 16 '18 at 6:38











  • ys I have install flannel network ,and all the system pods are working fine .This is the logs

    – Chintamani
    Nov 16 '18 at 9:41
















1















I have created a local ubuntu Kubernetes cluster, having 1 master and 2 slave nodes.



I deployed 2 applications in 2 pods and created service for both of the pods, it's working fine.
I entered inside pod by typing this command ,



$ kubectl exec -it firstpod /bin/bash
# apt-get update


Unable to make update and I'm getting an error:



Err http://security.debian.org jessie/updates InRelease

Err http://deb.debian.org jessie InRelease

Err http://deb.debian.org jessie-updates InRelease

Err http://security.debian.org jessie/updates Release.gpg Temporary failure resolving 'security.debian.org' Err http://deb.debian.org jessie-backports InRelease

Err http://deb.debian.org jessie Release.gpg Temporary failure resolving 'deb.debian.org' Err http://deb.debian.org jessie-updates Release.gpg Temporary failure resolving 'deb.debian.org' Err http://deb.debian.org jessie-backports Release.gpg Temporary failure resolving 'deb.debian.org' Reading package lists... Done W: Failed to fetch http://deb.debian.org/debian/dists/jessie/InRelease

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/InRelease

W: Failed to fetch http://security.debian.org/dists/jessie/updates/InRelease

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-backports/InRelease

W: Failed to fetch http://security.debian.org/dists/jessie/updates/Release.gpg Temporary failure resolving 'security.debian.org'

W: Failed to fetch http://deb.debian.org/debian/dists/jessie/Release.gpg Temporary failure resolving 'deb.debian.org'

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/Release.gpg Temporary failure resolving 'deb.debian.org'

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-backports/Release.gpg Temporary failure resolving 'deb.debian.org'

W: Some index files failed to download. They have been ignored, or old ones used instead.


I'm trying to ping my second pod service:



# ping secondservice (This is the service name of secondpod)
PING secondservice.default.svc.cluster.local (10.100.190.196): 56 data bytes
unable to ping.


How can I ping/call the second service from the first node?










share|improve this question



















  • 2





    Did you install pod network (calico/flannel.. etc) in your cluster? Also can you please check the kube-proxy pod's log?

    – hoque
    Nov 16 '18 at 6:23











  • Looks like you don't have any network...

    – Rico
    Nov 16 '18 at 6:38











  • ys I have install flannel network ,and all the system pods are working fine .This is the logs

    – Chintamani
    Nov 16 '18 at 9:41














1












1








1








I have created a local ubuntu Kubernetes cluster, having 1 master and 2 slave nodes.



I deployed 2 applications in 2 pods and created service for both of the pods, it's working fine.
I entered inside pod by typing this command ,



$ kubectl exec -it firstpod /bin/bash
# apt-get update


Unable to make update and I'm getting an error:



Err http://security.debian.org jessie/updates InRelease

Err http://deb.debian.org jessie InRelease

Err http://deb.debian.org jessie-updates InRelease

Err http://security.debian.org jessie/updates Release.gpg Temporary failure resolving 'security.debian.org' Err http://deb.debian.org jessie-backports InRelease

Err http://deb.debian.org jessie Release.gpg Temporary failure resolving 'deb.debian.org' Err http://deb.debian.org jessie-updates Release.gpg Temporary failure resolving 'deb.debian.org' Err http://deb.debian.org jessie-backports Release.gpg Temporary failure resolving 'deb.debian.org' Reading package lists... Done W: Failed to fetch http://deb.debian.org/debian/dists/jessie/InRelease

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/InRelease

W: Failed to fetch http://security.debian.org/dists/jessie/updates/InRelease

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-backports/InRelease

W: Failed to fetch http://security.debian.org/dists/jessie/updates/Release.gpg Temporary failure resolving 'security.debian.org'

W: Failed to fetch http://deb.debian.org/debian/dists/jessie/Release.gpg Temporary failure resolving 'deb.debian.org'

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/Release.gpg Temporary failure resolving 'deb.debian.org'

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-backports/Release.gpg Temporary failure resolving 'deb.debian.org'

W: Some index files failed to download. They have been ignored, or old ones used instead.


I'm trying to ping my second pod service:



# ping secondservice (This is the service name of secondpod)
PING secondservice.default.svc.cluster.local (10.100.190.196): 56 data bytes
unable to ping.


How can I ping/call the second service from the first node?










share|improve this question
















I have created a local ubuntu Kubernetes cluster, having 1 master and 2 slave nodes.



I deployed 2 applications in 2 pods and created service for both of the pods, it's working fine.
I entered inside pod by typing this command ,



$ kubectl exec -it firstpod /bin/bash
# apt-get update


Unable to make update and I'm getting an error:



Err http://security.debian.org jessie/updates InRelease

Err http://deb.debian.org jessie InRelease

Err http://deb.debian.org jessie-updates InRelease

Err http://security.debian.org jessie/updates Release.gpg Temporary failure resolving 'security.debian.org' Err http://deb.debian.org jessie-backports InRelease

Err http://deb.debian.org jessie Release.gpg Temporary failure resolving 'deb.debian.org' Err http://deb.debian.org jessie-updates Release.gpg Temporary failure resolving 'deb.debian.org' Err http://deb.debian.org jessie-backports Release.gpg Temporary failure resolving 'deb.debian.org' Reading package lists... Done W: Failed to fetch http://deb.debian.org/debian/dists/jessie/InRelease

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/InRelease

W: Failed to fetch http://security.debian.org/dists/jessie/updates/InRelease

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-backports/InRelease

W: Failed to fetch http://security.debian.org/dists/jessie/updates/Release.gpg Temporary failure resolving 'security.debian.org'

W: Failed to fetch http://deb.debian.org/debian/dists/jessie/Release.gpg Temporary failure resolving 'deb.debian.org'

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-updates/Release.gpg Temporary failure resolving 'deb.debian.org'

W: Failed to fetch http://deb.debian.org/debian/dists/jessie-backports/Release.gpg Temporary failure resolving 'deb.debian.org'

W: Some index files failed to download. They have been ignored, or old ones used instead.


I'm trying to ping my second pod service:



# ping secondservice (This is the service name of secondpod)
PING secondservice.default.svc.cluster.local (10.100.190.196): 56 data bytes
unable to ping.


How can I ping/call the second service from the first node?







kubernetes kubernetes-service






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 23 '18 at 8:45









halfer

14.7k759116




14.7k759116










asked Nov 16 '18 at 5:16









ChintamaniChintamani

2682728




2682728







  • 2





    Did you install pod network (calico/flannel.. etc) in your cluster? Also can you please check the kube-proxy pod's log?

    – hoque
    Nov 16 '18 at 6:23











  • Looks like you don't have any network...

    – Rico
    Nov 16 '18 at 6:38











  • ys I have install flannel network ,and all the system pods are working fine .This is the logs

    – Chintamani
    Nov 16 '18 at 9:41













  • 2





    Did you install pod network (calico/flannel.. etc) in your cluster? Also can you please check the kube-proxy pod's log?

    – hoque
    Nov 16 '18 at 6:23











  • Looks like you don't have any network...

    – Rico
    Nov 16 '18 at 6:38











  • ys I have install flannel network ,and all the system pods are working fine .This is the logs

    – Chintamani
    Nov 16 '18 at 9:41








2




2





Did you install pod network (calico/flannel.. etc) in your cluster? Also can you please check the kube-proxy pod's log?

– hoque
Nov 16 '18 at 6:23





Did you install pod network (calico/flannel.. etc) in your cluster? Also can you please check the kube-proxy pod's log?

– hoque
Nov 16 '18 at 6:23













Looks like you don't have any network...

– Rico
Nov 16 '18 at 6:38





Looks like you don't have any network...

– Rico
Nov 16 '18 at 6:38













ys I have install flannel network ,and all the system pods are working fine .This is the logs

– Chintamani
Nov 16 '18 at 9:41






ys I have install flannel network ,and all the system pods are working fine .This is the logs

– Chintamani
Nov 16 '18 at 9:41













1 Answer
1






active

oldest

votes


















1














There are two (unrelated) questions I see there. I'm going to focus on the second one since the first is unclear to me (what is the ask?).



So, you wonder why the following doesn't work:



# ping secondservice 


This is not a bug or unexpected (actually, I wrote about it here). In short: the FQDN secondservice.default.svc.cluster.local gets resolved via the DNS plugin to a virtual IP (VIP), the very essence of this VIP is that it is virtual, that is, it's not attached to a network interface, it's just a bunch of iptables rules. Hence, the ICMP-based ping has nothing to work against, since it's not a 'real' IP. You can curl the service, though. Assuming the service runs on port 9876, the following should work:



# curl secondservice:9876





share|improve this answer























  • Hi Michael ,there are 2 pods first and second and service firstservice and secondservice repectively .now I am in firstpod by typing command : kubectl exec -it firstpod /bin/bash .From here I am typing your curl command curl secondservice:3011 .but the output showing nothing .is this correct or is there other way .

    – Chintamani
    Nov 16 '18 at 10:12











  • Since I don't know your app I don't know what the expected output is. What do you mean with "showing nothing"? Do a curl -v and update your question with the output, please.

    – Michael Hausenblas
    Nov 16 '18 at 12:26






  • 1





    able to get the output .thank you .

    – Chintamani
    Nov 16 '18 at 13:15










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53331837%2funable-to-ping-one-service-to-another-service-in-kubernetes-cluster%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














There are two (unrelated) questions I see there. I'm going to focus on the second one since the first is unclear to me (what is the ask?).



So, you wonder why the following doesn't work:



# ping secondservice 


This is not a bug or unexpected (actually, I wrote about it here). In short: the FQDN secondservice.default.svc.cluster.local gets resolved via the DNS plugin to a virtual IP (VIP), the very essence of this VIP is that it is virtual, that is, it's not attached to a network interface, it's just a bunch of iptables rules. Hence, the ICMP-based ping has nothing to work against, since it's not a 'real' IP. You can curl the service, though. Assuming the service runs on port 9876, the following should work:



# curl secondservice:9876





share|improve this answer























  • Hi Michael ,there are 2 pods first and second and service firstservice and secondservice repectively .now I am in firstpod by typing command : kubectl exec -it firstpod /bin/bash .From here I am typing your curl command curl secondservice:3011 .but the output showing nothing .is this correct or is there other way .

    – Chintamani
    Nov 16 '18 at 10:12











  • Since I don't know your app I don't know what the expected output is. What do you mean with "showing nothing"? Do a curl -v and update your question with the output, please.

    – Michael Hausenblas
    Nov 16 '18 at 12:26






  • 1





    able to get the output .thank you .

    – Chintamani
    Nov 16 '18 at 13:15















1














There are two (unrelated) questions I see there. I'm going to focus on the second one since the first is unclear to me (what is the ask?).



So, you wonder why the following doesn't work:



# ping secondservice 


This is not a bug or unexpected (actually, I wrote about it here). In short: the FQDN secondservice.default.svc.cluster.local gets resolved via the DNS plugin to a virtual IP (VIP), the very essence of this VIP is that it is virtual, that is, it's not attached to a network interface, it's just a bunch of iptables rules. Hence, the ICMP-based ping has nothing to work against, since it's not a 'real' IP. You can curl the service, though. Assuming the service runs on port 9876, the following should work:



# curl secondservice:9876





share|improve this answer























  • Hi Michael ,there are 2 pods first and second and service firstservice and secondservice repectively .now I am in firstpod by typing command : kubectl exec -it firstpod /bin/bash .From here I am typing your curl command curl secondservice:3011 .but the output showing nothing .is this correct or is there other way .

    – Chintamani
    Nov 16 '18 at 10:12











  • Since I don't know your app I don't know what the expected output is. What do you mean with "showing nothing"? Do a curl -v and update your question with the output, please.

    – Michael Hausenblas
    Nov 16 '18 at 12:26






  • 1





    able to get the output .thank you .

    – Chintamani
    Nov 16 '18 at 13:15













1












1








1







There are two (unrelated) questions I see there. I'm going to focus on the second one since the first is unclear to me (what is the ask?).



So, you wonder why the following doesn't work:



# ping secondservice 


This is not a bug or unexpected (actually, I wrote about it here). In short: the FQDN secondservice.default.svc.cluster.local gets resolved via the DNS plugin to a virtual IP (VIP), the very essence of this VIP is that it is virtual, that is, it's not attached to a network interface, it's just a bunch of iptables rules. Hence, the ICMP-based ping has nothing to work against, since it's not a 'real' IP. You can curl the service, though. Assuming the service runs on port 9876, the following should work:



# curl secondservice:9876





share|improve this answer













There are two (unrelated) questions I see there. I'm going to focus on the second one since the first is unclear to me (what is the ask?).



So, you wonder why the following doesn't work:



# ping secondservice 


This is not a bug or unexpected (actually, I wrote about it here). In short: the FQDN secondservice.default.svc.cluster.local gets resolved via the DNS plugin to a virtual IP (VIP), the very essence of this VIP is that it is virtual, that is, it's not attached to a network interface, it's just a bunch of iptables rules. Hence, the ICMP-based ping has nothing to work against, since it's not a 'real' IP. You can curl the service, though. Assuming the service runs on port 9876, the following should work:



# curl secondservice:9876






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 16 '18 at 9:43









Michael HausenblasMichael Hausenblas

6,44622243




6,44622243












  • Hi Michael ,there are 2 pods first and second and service firstservice and secondservice repectively .now I am in firstpod by typing command : kubectl exec -it firstpod /bin/bash .From here I am typing your curl command curl secondservice:3011 .but the output showing nothing .is this correct or is there other way .

    – Chintamani
    Nov 16 '18 at 10:12











  • Since I don't know your app I don't know what the expected output is. What do you mean with "showing nothing"? Do a curl -v and update your question with the output, please.

    – Michael Hausenblas
    Nov 16 '18 at 12:26






  • 1





    able to get the output .thank you .

    – Chintamani
    Nov 16 '18 at 13:15

















  • Hi Michael ,there are 2 pods first and second and service firstservice and secondservice repectively .now I am in firstpod by typing command : kubectl exec -it firstpod /bin/bash .From here I am typing your curl command curl secondservice:3011 .but the output showing nothing .is this correct or is there other way .

    – Chintamani
    Nov 16 '18 at 10:12











  • Since I don't know your app I don't know what the expected output is. What do you mean with "showing nothing"? Do a curl -v and update your question with the output, please.

    – Michael Hausenblas
    Nov 16 '18 at 12:26






  • 1





    able to get the output .thank you .

    – Chintamani
    Nov 16 '18 at 13:15
















Hi Michael ,there are 2 pods first and second and service firstservice and secondservice repectively .now I am in firstpod by typing command : kubectl exec -it firstpod /bin/bash .From here I am typing your curl command curl secondservice:3011 .but the output showing nothing .is this correct or is there other way .

– Chintamani
Nov 16 '18 at 10:12





Hi Michael ,there are 2 pods first and second and service firstservice and secondservice repectively .now I am in firstpod by typing command : kubectl exec -it firstpod /bin/bash .From here I am typing your curl command curl secondservice:3011 .but the output showing nothing .is this correct or is there other way .

– Chintamani
Nov 16 '18 at 10:12













Since I don't know your app I don't know what the expected output is. What do you mean with "showing nothing"? Do a curl -v and update your question with the output, please.

– Michael Hausenblas
Nov 16 '18 at 12:26





Since I don't know your app I don't know what the expected output is. What do you mean with "showing nothing"? Do a curl -v and update your question with the output, please.

– Michael Hausenblas
Nov 16 '18 at 12:26




1




1





able to get the output .thank you .

– Chintamani
Nov 16 '18 at 13:15





able to get the output .thank you .

– Chintamani
Nov 16 '18 at 13:15



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53331837%2funable-to-ping-one-service-to-another-service-in-kubernetes-cluster%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

ReactJS Fetched API data displays live - need Data displayed static

Evgeni Malkin