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

Giornate difficili

“Oggi è stata una giornata difficile”, disse Pooh.Ci fu una pausa.“Vuoi parlarne?” chiese Pimpi.“No” disse Pooh dopo un po’. “No, non credo”.“Va bene”, disse Pimpi, e si sedette accanto al suo amico.“Cosa stai facendo?” chiese Pooh.“Niente” disse Pimpi. “Solo, so come sono i giorni difficili. Molto spesso non va di parlare neanche a me nei miei giorni difficili”.“Ma…” continuò Pimpi, “i giorni difficili sono molto più facili quando sai di avere qualcuno lì per te. E io sarò sempre qui per te, Pooh.”E mentre Pooh sedeva lì, rimuginando sulle difficoltà della giornata, mentre Pimpi sedeva accanto a lui in silenzio, facendo oscillare le sue piccole gambe… pensava che il suo migliore amico aveva proprio ragione 🐻💛🐷

Deploying Kubernetes on bare metal with Rancher 2.0

Contents Install Rancher server Create a Kubernetes cluster Add Kubernetes nodes Install StorageOS as the Kubernetes storage class Understand Nginx Ingress in Rancher Install Rancher Create a VM with Docker and Docker Compose installed and install Rancher 2.0 with docker compose: Rancher docker-compose file: docker-compose.yaml Run these commands to install Rancher with docker compose: git clone https://github.com/polinchw/rancher-docker-compose cd rancher-docker-compose docker-compose up -d Create your Kubernetes cluster with Rancher Install a custom Kubernetes cluster with Rancher. Use the ‘Custom’ cluster. Add Kubernetes nodes and join the Kubernetes cluster Run the following commands on all the VMs that your Kubernetes cluster will run on. The final docker command will have the VM join the new Kubernetes cluster. Replace the –server and –token with your Rancher server and cluster token. Download the kub config file for the cluster After you download the kub config file you can use… Leggi tuttoDeploying Kubernetes on bare metal with Rancher 2.0