diff --git a/jsonnet/kube-prometheus/prometheus/prometheus.libsonnet b/jsonnet/kube-prometheus/prometheus/prometheus.libsonnet index 82c4fc90823aa6bfa29659e16c0be842967d6141..89d55bcc8abe0b540b3bebb0c0498bb8dcd8fec8 100644 --- a/jsonnet/kube-prometheus/prometheus/prometheus.libsonnet +++ b/jsonnet/kube-prometheus/prometheus/prometheus.libsonnet @@ -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']: