cortex
cortex copied to clipboard
Restrict /flush and /shutdown ingester endpoints to POST method only
As discussed in https://github.com/cortexproject/cortex/pull/3228#discussion_r493859743, we should restrict /flush
and /shutdown
ingester endpoints to POST
HTTP method only.
When doing it we should also:
- Make it clear in the
/
page that they'rePOST
only (because if you will click these links from the browser, it will show a 405 error) - Change
tools/migrate-ingester-statefulsets.sh
because calls GET /shutdown, but then we would have to use something different than wget (and curl is not available in Cortex images)
Should we add a button on the page instead of the link?
Button sounds good to me. It may need some changes to “IndexPage” code.
Change tools/migrate-ingester-statefulsets.sh because calls GET /shutdown, but then we would have to use something different than wget (and curl is not available in Cortex images)
I think I had my mind turned off when I wrote this. We don't run the script from the Cortex image. We can just replace it with curl -X POST
.
I think I had my mind turned off when I wrote this. We don't run the script from the Cortex image. We can just replace it with curl -X POST.
We can run curl from machine that runs the script, but then we need to deal with background port forwarding and possible port collisions. When I tried that, port forward sometimes took longer to setup, so curl failed. In the end I chose to run “wget” from within the container instead, which doesn’t have these problems.