Welcome to the Linux Foundation Forum!

Exercise 2.3.7 - timeout

Hi,
After creating the basicpod with basicpod.yaml:

apiVersion: v1
kind: Pod
metadata:
name: basicpod
spec:
containers:
- name: webcont
image: nginx
ports:
- containerPort: 80

I try to reach it with
curl http://ip address
But get a timeout.

Any ideas? Do I need to map the port somehow?

Comments

  • serewicz
    serewicz Posts: 1,000

    Hello,

    Without knowing what IP you are using this would be difficult to troubleshoot. Are you using the pod ephemeral IP? Otherwise you would need to create a service, which the lab should direct you to do next.

    Regards,

  • oynaz
    oynaz Posts: 3

    Hi,
    Thanks a lot for the reply. I moved on and created the service, but I still have the same issue.

    curl http://192.168.125.133
    and
    curl http://10.102.119.228

    gives me timeouts

    basic.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    name: basicpod
    labels:
    type: webserver
    spec:
    containers:
    - name: webcont
    image: nginx
    ports:
    - containerPort: 80

    basicservice.yaml
    apiVersion: v1
    kind: Service
    metadata:
    name: basicservice
    spec:
    selector:
    type: webserver
    ports:
    - protocol: TCP
    port: 80

    kubectl get pod -o wide
    NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
    basicpod 1/1 Running 0 10m 192.168.125.133 jengelkuberwork

    kubectl get svc
    NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
    basicservice ClusterIP 10.102.119.228 80/TCP 10m
    kubernetes ClusterIP 10.96.0.1 443/TCP 4d19h

    Hope you can help :-)

  • serewicz
    serewicz Posts: 1,000

    Hello,

    As the pod indicates it is running then the issue probably has to do with your network. I'm unsure which node the pod is on. If it is on your worker, can you curl when on that node? If so then you have a firewall issue.

    What are you using to run your labs? If using GCE ensure the VPC allows all traffic.

    Regards,

  • oynaz
    oynaz Posts: 3

    Hi,
    Thanks again.
    I run the nodes in Azure as 2 Ubuntu 20.04.2 LTS VMs

    I am logged on to the master node, where I both run the pod and service, and run curl
    I also tried creating the same environment on my Windows 10 laptop - same result. Also in a browser.

    Since I run curl from the same machine I run the pods and service, I doubt it is a network issue. But I cannot figure out what else it could be.

    Any suggestions appreciated :-)

  • serewicz
    serewicz Posts: 1,000
    edited July 2021

    Hello,

    Azure is known to cause issues with networking and Kubernetes. The labs will run on AWS, GCE, Digital Ocean, VMWare, VirtualBox, KVM/QEMU, and bare metal among others. So far Azure is the only provider which has these issues, which have been occurring for years. I encourage you to use a different provider or setup for the labs. Also the setup guide calls for Ubuntu 18.04, which may have different networking considerations than 20.04.

    Regards,

Categories

Upcoming Training