Add SessionAffinity ClusterIP to prometheus service.

Adds SessionAffinity ClusterIP to the prometheus service to prevent grafana from querying different instances when loading/updating metrics.
This commit is contained in:
BennX
2019-01-08 15:57:40 +01:00
committed by Benjamin Meyer
parent 688629392a
commit cb149a10bc

View File

@@ -38,6 +38,7 @@ local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet';
local prometheusPort = servicePort.newNamed('web', 9090, 'web');
service.new('prometheus-' + $._config.prometheus.name, { app: 'prometheus', prometheus: $._config.prometheus.name }, prometheusPort) +
service.mixin.spec.withSessionAffinity('ClientIP') +
service.mixin.metadata.withNamespace($._config.namespace) +
service.mixin.metadata.withLabels({ prometheus: $._config.prometheus.name }),
[if $._config.prometheus.rules != null && $._config.prometheus.rules != {} then 'rules']: