Skip to content

Webservice: Set different shutdown.blackout_seconds for different deployments

Summary

(Summarize the bug encountered, concisely as possible)

For websockets and future deployments like API and Web we would like to set a different values for shutdown.blackoutSeconds which sets how log puma will run after receiving a SIGINT.

https://gitlab.com/gitlab-org/charts/gitlab/-/blob/55ad21613dc4e19b104e53ab8fe36cd76cae212b/charts/gitlab/charts/webservice/templates/configmap.yml#L136-137

This field is present in the datamodel but all deployments share a single configmap.

I don't believe there is any other place where we need to diverge gitlab.yml configuration per deployment. This will be important when we migrate the API/Web fleet since for Git HTTPs we need to tolerate connections that live longer than regular web requests.

Another option I am thinking is that we can override this with an environment variable https://gitlab.com/gitlab-org/gitlab/-/blob/7ff0058a15bbedce3657d5fd5b8b0d67bd2c8b68/config/initializers/1_settings.rb#L883 with something like GITLAB_BLACKOUT_SECONDS which would be less impactful for charts, in this case we would just need to omit the value from the configmap if it isn't defined.

this is a kubernetes-migration-blocker for the API migration

Steps to reproduce

Configure as below, and see that only one ConfigMap is generated, resulting in the chart level setting being observed.

Configuration used

gitlab:
  webservice:
    shutdown: # chart
      blackoutSeconds: 10
    deployments:
      websockets:
        shutdown: # just for websockets
          blackoutSeconds: 0

Current behavior

kind: ConfigMap
metadata:
  name: rvw-ci-helm-relname-webservice
...
data:
  gitlab.yml.erb |
...
   shutdown:                                                                                
     blackout_seconds: 10
...

Expected behavior

Ability to control this on a per-deployment level.

Versions

  • Chart: (tagged version | branch | hash git rev-parse HEAD)
  • Platform:
    • Cloud: (GKE | AKS | EKS | ?)
    • Self-hosted: (OpenShift | Minikube | Rancher RKE | ?)
  • Kubernetes: (kubectl version)
    • Client:
    • Server:
  • Helm: (helm version)
    • Client:
    • Server:

Relevant logs

(Please provide any relevate log snippets you have collected, using code blocks (```) to format)

Edited by Jason Plum