NGINX/PHP-FPM graceful shutdown and 502 errors

We have a PHP application running with Kubernetes in pods with two dedicated containers — NGINX и PHP-FPM. The problem is that during downscaling clients get 502 errors. E.g. when a pod is stopping, its containers can not correctly close existing connections. So, in this post, we will take a closer look at the pods’ termination process in general, and NGINX and PHP-FPM containers in particular. Testing will be performed on the AWS Elastic Kubernetes Service by the Yandex.Tank utility. Ingress resource will create an AWS Application Load Balancer with the AWS ALB Ingress Controller. Для управления контейнерами на Kubernetes WorkerNodes испольузется Docker. Pod Lifecycle — Termination of Pods So, let’s take an overview of the pods’ stopping and termination process. Basically, a pod is a set of processes running on a Kubernetes WorkerNode, which are stopped by standard IPC (Inter-Process Communication) signals. To… Leggi tuttoNGINX/PHP-FPM graceful shutdown and 502 errors