-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Invoke DELETE on pod prepare-downscale path if any POSTs failed (#146)
This addresses a bug in rollout-operator where: 1. Kubernetes receives a request to downscale a statefulset by `X` hosts. 2. The prepare-downscale admission webhook attempts to prepare `X` pods for shutdown by sending an HTTP `POST` to their handler identified by the `grafana.com/prepare-downscale-http-path` and `-port` annotations. 3. At least one of these requests fails. The admission webhook returns an error to Kubernetes, so the downscale is not approved. 4. 💥 But some hosts may have been prepared for downscale. 💥 This PR adds cleanup logic to issue `DELETE` requests on all involved pods if any of the `POST`s failed. Notes: * `DELETE` calls are attempted once. * `DELETE` failures are logged but otherwise ignored. * For simplicity, we'll invoke `DELETE` on all of the pods involved in the scaledown operation, not just ones that received a POST. This doesn't fix the similar issue where replica count changing from 10->9->10 leaves that one pod prepared for shutdown. (But that's in the works.)
- Loading branch information
1 parent
ea17193
commit 33c4fcf
Showing
4 changed files
with
185 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters