Unable to ping one service to another service in Kubernetes cluster?
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
add a comment |
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
2
Did you install pod network (calico/flannel.. etc) in your cluster? Also can you please check thekube-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
add a comment |
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
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
kubernetes kubernetes-service
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 thekube-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
add a comment |
2
Did you install pod network (calico/flannel.. etc) in your cluster? Also can you please check thekube-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
add a comment |
1 Answer
1
active
oldest
votes
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
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 acurl -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
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
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 acurl -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
add a comment |
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
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 acurl -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
add a comment |
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
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
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 acurl -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
add a comment |
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 acurl -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
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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