Skip to content

Commit 5e810e9

Browse files
authored
Use policy/v1 PodDisruptionBudget to support k8s 1.25+ (#17)
Signed-off-by: Friedrich Gonzalez <[email protected]> Signed-off-by: Friedrich Gonzalez <[email protected]>
1 parent 625394c commit 5e810e9

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## master / unreleased
4+
5+
* [CHANGE] Use policy/v1 PodDisruptionBudget to support k8s 1.25+
6+
37
## 1.11.1 / 2023-01-13
48

59
* [CHANGE] Updated readme to use this repo with tanka

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ test-readme: test-readme/azure test-readme/gcs test-readme/s3
4949
test-readme/%:
5050
rm -rf $@ && \
5151
mkdir -p $@ && cd $@ && \
52-
tk init --k8s=1.21 && \
52+
tk init --k8s=1.23 && \
5353
jb install github.com/cortexproject/cortex-jsonnet/cortex@main && \
5454
rm -fr ./vendor/cortex && \
5555
cp -r ../../cortex ./vendor/ && \

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ To generate the YAMLs for deploying Cortex:
2525

2626
```console
2727
$ mkdir <name> && cd <name>
28-
$ tk init --k8s=1.21 # this includes github.com/jsonnet-libs/k8s-libsonnet/1.21@main
28+
$ tk init --k8s=1.23 # this includes github.com/jsonnet-libs/k8s-libsonnet/1.23@main
2929
$ jb install github.com/cortexproject/cortex-jsonnet/cortex@main
3030
```
3131

cortex/ingester.libsonnet

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
local podDisruptionBudget = $.policy.v1beta1.podDisruptionBudget,
2+
local podDisruptionBudget = $.policy.v1.podDisruptionBudget,
33
local pvc = $.core.v1.persistentVolumeClaim,
44
local statefulSet = $.apps.v1.statefulSet,
55
local volume = $.core.v1.volume,
@@ -90,8 +90,7 @@
9090
ingester_service_ignored_labels:: [],
9191

9292
newIngesterPdb(pdbName, ingesterName)::
93-
podDisruptionBudget.new() +
94-
podDisruptionBudget.mixin.metadata.withName(pdbName) +
93+
podDisruptionBudget.new(pdbName) +
9594
podDisruptionBudget.mixin.metadata.withLabels({ name: pdbName }) +
9695
podDisruptionBudget.mixin.spec.selector.withMatchLabels({ name: ingesterName }) +
9796
podDisruptionBudget.mixin.spec.withMaxUnavailable(1),

cortex/store-gateway.libsonnet

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
local container = $.core.v1.container,
3-
local podDisruptionBudget = $.policy.v1beta1.podDisruptionBudget,
3+
local podDisruptionBudget = $.policy.v1.podDisruptionBudget,
44
local pvc = $.core.v1.persistentVolumeClaim,
55
local statefulSet = $.apps.v1.statefulSet,
66
local volumeMount = $.core.v1.volumeMount,
@@ -69,8 +69,7 @@
6969
$.util.serviceFor($.store_gateway_statefulset),
7070

7171
store_gateway_pdb:
72-
podDisruptionBudget.new() +
73-
podDisruptionBudget.mixin.metadata.withName('store-gateway-pdb') +
72+
podDisruptionBudget.new('store-gateway-pdb') +
7473
podDisruptionBudget.mixin.metadata.withLabels({ name: 'store-gateway-pdb' }) +
7574
podDisruptionBudget.mixin.spec.selector.withMatchLabels({ name: 'store-gateway' }) +
7675
// To avoid any disruption in the read path we need at least 1 replica of each

0 commit comments

Comments
 (0)