*Lightening lab 2, task 1*: When I set up container and readiness probe *port to . . .

Hubert Wójtowicz:
Lightening lab 2, task 1: When I set up container and readiness probe port to 9080 as instructor suggested it will set pod as ready, whereas when I change container and readiness probe port to 8080 it says: Readiness probe failed: Get "<http://10.50.192.3:8080/>": dial tcp 10.50.192.3:8080: connect: connection refused . Why is that happening? Why is port 8080 is blocked?


Mohamed Ihsan:
The image is build to expose / listen on port 9080 only. Therefore readiness probe should connect to the same port.

Hubert Wójtowicz:
@Mohamed Ihsan
> I set up container and readiness probe port to 9080
> when I change container and readiness probe port to 8080
I noticed that both container and readiness probe have to be the same, but if they are the same and equal to 8080 they fail. The question is why 8080 is not valid port?

Hubert Wójtowicz:

Hubert Wójtowicz:
I see image expose only port 80 @Mohamed Ihsan

Hubert Wójtowicz:
I still does not understand why this port for readiness is limited to 9080.

Hubert Wójtowicz:
Ok I couldn’t run/install netstat there, but I found this configuration:

Mohamed Ihsan:
:+1:

Hello, I faced same problem as above.
Even when i proceed as instructor says, my liveness probe is failing. tried multiple times.

Events:
Type Reason Age From Message


Normal Pulled 22s kubelet Container image “kodekloud/nginx” already present on machine
Normal Created 22s kubelet Created container nginx
Normal Started 21s kubelet Started container nginx
Warning Unhealthy 6s kubelet Liveness probe failed: ls: cannot access ‘/var/www/html/file_check’: No such file or directory

Anyone has idea what is wrong?
I had added following lines in pod.yaml:

livenessProbe:
exec:
command:
- ls
- /var/www/html/file_check
initialDelaySeconds: 10
periodSeconds: 60