kubernetes-ingress icon indicating copy to clipboard operation
kubernetes-ingress copied to clipboard

Add lifecycle to controller container

Open coolbry95 opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] Add lifecycle configuration for the controller container. This allows preStop hooks to allow for draining of connections at the ingress.

Describe the solution you'd like A clear and concise description of what you want to happen. Add lifecycle configuration to the helm chart.

lifecycle:
   preStop:
      exec:
         command: ["/bin/sh","-c","sleep 10 && /usr/sbin/nginx -s reload"]

Describe alternatives you've considered Related #267

Additional context

coolbry95 avatar Sep 02 '22 13:09 coolbry95

Hi @coolbry95 thanks for reporting!

Be sure to check out the docs while you wait for a human to take a look at this :slightly_smiling_face:

Cheers!

github-actions[bot] avatar Sep 02 '22 13:09 github-actions[bot]

Hi @coolbry95

I think I was a little bit confused by the issue that was mentioned as related. I think you're talking about a graceful shutdown before the Ingress Controller gets terminated, right? That's different from #267 and should be already happening.

When the IC pod gets a SIGTERM from k8s, we send a quit to nginx, which is a request for graceful shutdown, so if you're seeing something different it could be a bug.

Do you have any logs that you can share or anything that shows that nginx is not behaving correctly?

lucacome avatar Sep 08 '22 23:09 lucacome

It looks like we are not having issues.

For testing we used a command like bombardier -k --http2 -r 200 -d10m -c48 -m POST --latencies https://dev-srl-usw2.starlightglade.com/performance/0. While the command is running cycle the nginx pods by adding an annotation to the deployment spec, do a rollout restart deploy, or delete the pods manually. There shouldn't be any errors or 500s.

coolbry95 avatar Sep 13 '22 17:09 coolbry95