my Resource manifest file:
---
kind: Pod
apiVersion: v1
metadata:
name: web
spec:
containers:
- name: nginx
image: nginx
readinessProbe:
tcpSocket:
host: 127.0.0.1
port: 9000
- name: php
image: php-fpm
I need to check if the PHP service is up and running within the Nginx container. The failure should be detected only if the PHP service has been confirmed to start successfully.
After debugging, I found that the tcpSocket.host
parameter should have used the network namespace of the web container, but mistakenly used the host machine’s namespace. Omitting the tcpSocket.host
parameter allows the probe to function correctly.
I found that startupProbe
, readinessProbe
, and livenessProbe
all have the same issue.
Kubernetes version: v1.29.2
Cloud being used: bare-metal
Installation method: kubeadm
Host OS: Rocky-Linux-8.5
CNI and version: v3.26.4
CRI and version: containerd 1.6.28-3