Welcome to the Linux Foundation Forum!

Lab 2.3 Connection Failure for Service

Posts: 1
edited February 2019 in LFD259 Class Forum

I took down the single pod and created/edited the basicservice.yaml and basic.yaml files.
I ran create for the pod and then the service as instructed.
It all looks okay:

  1. NAME READY STATUS RESTARTS AGE
  2. pod/basicpod 1/1 Running 0 13m
  3.  
  4. NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
  5. service/basicservice ClusterIP 10.102.33.90 <none> 80/TCP 13m
  6. service/kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 17h

However when I try to reach the service at the cluster-ip:

  1. curl 10.102.33.90
  2. curl: (7) Couldn't connect to server

But curling the pod directly seems to work:

  1. get pod -o wide
  2. NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
  3. basicpod 1/1 Running 0 16m 192.168.1.10 worker <none> <none>
  4. curl 192.168.1.10
  5. <!DOCTYPE html> ...

Does anyone have any suggestions about what I can do to solve/diagnosis this problem?
Thanks!

Here are the yaml contents:

  1. $ cat basic.yaml
  2. apiVersion: v1
  3. kind: Pod
  4. metadata:
  5. name: basicpod
  6. labels:
  7. type: websever
  8. spec:
  9. containers:
  10. - name: webcont
  11. image: nginx
  12. ports:
  13. - containerPort: 80
  14. $ cat basicservice.yaml
  15. apiVersion: v1
  16. kind: Service
  17. metadata:
  18. name: basicservice
  19. spec:
  20. selector:
  21. type: webserver
  22. ports:
  23. - protocol: TCP
  24. port: 80

Comments

  • Hi @wallace, similar connectivity issues with Lab 2 have been reported earlier in the forum, and most have been resolved with solutions posted in the forum as well.
    Search thru the forum, you may find a situation similar to yours, and most likely resolved.
    These early connectivity issues are not kubernetes related. They are caused by improper infrastructure setup - especially networking.
    Depending on your setup, cloud VMs vs local hypervisor, you may be encountering networking issues between your Nodes/VMs. In the cloud, you may not have created a custom VPC and a custom firewall open to all traffic. Local hypervisors have specific networking settings to allow all traffic between the VMs. You may also have a firewall running on your Nodes blocking some of the traffic.
    Regards,
    -Chris

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