jsonnet: make prometheus-adapter highly-available
Prometheus-adapter is a component of the monitoring stack that in most
cases require to be highly available. For instance, we most likely
always want the autoscaling pipeline to be available and we also want to
avoid having no available backends serving the metrics API apiservices
has it would result in both the AggregatedAPIDown alert firing and the
kubectl top command not working anymore.
In order to make the adapter highly-avaible, we need to increase its
replica count to 2 and come up with a rolling update strategy and a
pod anti-affinity rule based on the kubernetes hostname to prevent the
adapters to be scheduled on the same node. The default rolling update
strategy for deployments isn't enough as the default maxUnavaible value
is 25% and is rounded down to 0. This means that during rolling-updates
scheduling will fail if there isn't more nodes than the number of
replicas. As for the maxSurge, the default should be fine as it is
rounded up to 1, but for clarity it might be better to just set it to 1.
For the pod anti-affinity constraints, it would be best if it was hard,
but having it soft should be good enough and fit most use-cases.
Signed-off-by:
Damien Grisonnet <dgrisonn@redhat.com>
Showing
- jsonnet/kube-prometheus/addons/anti-affinity.libsonnet 24 additions, 12 deletionsjsonnet/kube-prometheus/addons/anti-affinity.libsonnet
- jsonnet/kube-prometheus/components/prometheus-adapter.libsonnet 3 additions, 2 deletions...t/kube-prometheus/components/prometheus-adapter.libsonnet
- manifests/prometheus-adapter-deployment.yaml 2 additions, 2 deletionsmanifests/prometheus-adapter-deployment.yaml
Loading
Please register or sign in to comment