Kubernetes services say connection refused.

1,395 views
Skip to first unread message

Gul Md Ershad

unread,
Sep 7, 2018, 12:50:22 PM9/7/18
to Kubernetes developer/contributor discussion
Hi Team,

I have created pod like below for a container:

apiVersion: v1

kind: Pod

metadata:

  name: abc-pod

  labels:

    zone: prod

    version: v1

    name: abc-pod

spec:

  containers:

  - name: abc-ctr

    image: myimage:v0.5

    command: ["sh", "-c", "tail -f /dev/null"]

    ports:

    - containerPort: 5000

      name: http

      protocol: TCP



And, I exposed like below:


kubectl expose pod abc-pod --type=NodePort --port=5000


This runs very well and it is exposed properly.


but while accessing its API. It says connection refused. 


Please help.


 

 

Andrew Lytvynov

unread,
Sep 7, 2018, 1:06:37 PM9/7/18
to Gul Md Ershad, Kubernetes developer/contributor discussion
There should be something within the container actually listening on that port. tail command just outputs to stdout, it doesn't listen on any ports.

--
You received this message because you are subscribed to the Google Groups "Kubernetes developer/contributor discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-de...@googlegroups.com.
To post to this group, send email to kuberne...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubernetes-dev/3ad4119d-d1a5-4748-b363-c3cb58d5a754%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages