jsonnet: add PDB to prometheus-adapter

Adding a PodDisruptionBudget to prometheus-adapter ensure that at least
one replica of the adapter is always available. This make sure that even
during disruption the aggregated API is available and thus does not
impact the availability of the apiserver.

Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
This commit is contained in:
Damien Grisonnet committed 2021-05-05 17:08:18 +02:00
1 parent ba330fcd6a
commit 7760c2b801
3 files changed
+34

No files matched your search

@@ -300,4 +300,20 @@ function(params) {
namespace: pa._config.namespace,
}],
},
[if (defaults + params).replicas > 1 then 'podDisruptionBudget']: {
apiVersion: 'policy/v1beta1',
kind: 'PodDisruptionBudget',
metadata: {
name: pa._config.name,
namespace: pa._config.namespace,
labels: pa._config.commonLabels,
},
spec: {
minAvailable: 1,
selector: {
matchLabels: pa._config.selectorLabels,
},
},
},
}