Welcome to the Linux Foundation Forum!

Lab 2.3 create a basic pod - cannot connect to pod via CLUSTER IP

So I am using Ubuntu 20.04, not 18.04. Everything working great but for lab 2.3, step 11, if I try to access to the web server using the CLUSTER-IP for the basicservice, I get a connection time out:

curl: (7) Failed to connect to 10.99.248.201 port 80: Connection refused

Now if I try to hit the pod directly by its IP, I get expected result.

  1. ubuntu@my-master-node:~$ kubectl get svc
  2. NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
  3. basicservice NodePort 10.99.248.201 <none> 80:32489/TCP 2m58s
  4. kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 29m
  5.  
  6. ubuntu@my-master-node:~$ curl http://10.99.248.201
  7. curl: (7) Failed to connect to 10.99.248.201 port 80: Connection refused
  8.  
  9. ubuntu@my-master-node:~$ kubectl get pod -o wide
  10. NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
  11. basicpod 1/1 Running 0 21s 192.168.208.194 ip-172-31-36-1 <none> <none>
  12.  
  13. ubuntu@my-master-node:~$ curl http://192.168.208.194
  14. <!DOCTYPE html>
  15. [...]

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Comments

  • If you're using aws or gcp, make sure your security group & vpc nacl (aws)/firewall rule (gcp) isn't blocking the request to your cluster ip. I had this issue until I added a firewall rule to allow all traffic from all src ips. (0.0.0.0/0) Of course you can tighten these up but it's a quick way to see if that's the root cause.

  • Hi and thanks for your comment. I have checked all that and it's all open.

  • I'm not sure I understand what that IP is anyway? I understand hitting the POD through its IP (and it's running on the other node) and that';s working fine, but what's the basic service IP for ?

  • Never mind, I went through basic.yaml and basicservice.yaml and I got some lines wrong. All working now

  • Hi @bendubuisson , I am facing the same issue. Could you please let me know what helped you to fix the issue?

  • Never mind, had missed a few configs, got it.

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Welcome!

It looks like you're new here. Sign in or register to get started.
Sign In

Categories

Upcoming Training