Kubernetes + nginx + php-fpm

Asking for help? Comment out what you need so we can get more information to help you!

Cluster information:

Kubernetes version: 1.24
Cloud being used: (put bare-metal if not on a public cloud)
Installation method:
Host OS: ubuntu 20.04 (Vmware)
CNI and version:
CRI and version:

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.

hello,
i am setting up a nginx + php-fpm in different pods and same namespaces. I have the problem of connect refused in the question asking nginx against php-fpm:

[error] 9#9: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 10.1.1.232, server: cluster.test, request: “GET / HTTP/1.1”, upstream: “fastcgi://XX.XX.XX.XX:9000”, host: “XXXXX”

Hi,
This information is not enough.

Hello,
Please find attached all the information about this problem.

I have a master and a worker, I have deployed a nginx and php-fpm as deployment and service.

kubectl get svc -A

NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
default kubernetes ClusterIP 10.96.0.1 443/TCP 14d
isid nginx-ingress NodePort 10.97.46.145 80:32608/TCP 18h
isid php-fpm ClusterIP 10.96.55.23 9000/TCP 18h
kube-system kube-dns ClusterIP 10.96.0.10 53/UDP,53/TCP,9153/TCP 14d

And when I do a http://ip_worker:puerto_svc it gives the following error:
2022/07/14 11:54:23 [error] 9#9: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 10.1.1.232, server: agora.lab, request: “GET / HTTP/1.1”, upstream: “fastcgi://10.96.55.23:9000”, host: “labk8sworker01”
10.1.1.232 - - [14/Jul/2022:11:54:23 +0000] “GET / HTTP/1.1” 502 150 “-” “curl/7.68.0”

On the other hand, in this case, what would be the best way to deploy nginx + php-fpm, with independent pods or in the same pod both containers?

can you think of any idea why it does not connect nginx against php-fpm?