-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Kubernetes
Sidekiq is a cluster of worker processes "around" a Redis server. This page provides information on how to operate Sidekiq using Kubernetes.
Running and connecting to Redis...
How to configure k8s to get a clean shutdown with TSTP and TERM...
During the termination lifecycle, k8s will send a SIGTERM to the root process on each pod:
In practice, this means your application needs to handle the SIGTERM message and begin shutting down when it receives it. This means saving all data that needs to be saved, closing down network connections, finishing any work that is left, and other similar tasks.
Sidekiq uses the TERM signal to start shutting down within the timeout/-t seconds.
k8s also has its own concept of a grace period, indicated by the terminationGracePeriodSeconds in the pod's configuration. k8s will wait this amount of time before sending a SIGKILL to the container, forcefully terminating all processes.
It's recommend to have the Sidekiq timeout set to a value less than the k8s terminationGracePeriodSeconds. If using the default Sidekiq timeout of 25 seconds, setting terminationGracePeriodSeconds in k8s to 30 seconds is recommended (the k8s default).
How to get Kubernetes to verify Sidekiq process health...
Scaling via queue latency...
Notes about using AWS, GCP, DO and other KaaS providers...?