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

  • 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 :-)

  • 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 :-)

Categories

Upcoming Training