Skip to content

Add a preStop hook to registry to sleep for 5 seconds

Graeme Gillies requested to merge ggillies/add-preStop-hook-registry into master

What does this MR do?

Add a preStop hook to registry to sleep for 5 seconds

While we have an option to configure the draintimeout for the registry configuration, there are very small windows where if no requests are currently going to registry, and it gets a SIGTERM as part of the standard Kubernetes shutdown procedure, registry will terminate before all nodes have a chance to remove the pod endpoint from the Kubernetes service, causing small amounts of connection errors.

This change adds a preStop hook which simply sleeps for 5 seconds, which will give Kubernetes nodes enough time to remove the pod endpoint from iptables via kube-proxy, making sure there is never a window that requests to registry will go to a pod that is terminated.

Related issues

Closes #2911 (closed)

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion.

Required

  • Merge Request Title and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Tests added
  • Integration tests added to GitLab QA
  • Equivalent MR/issue for omnibus-gitlab opened
Edited by Graeme Gillies

Merge request reports