diff --git a/jsonnet/kube-prometheus/kube-prometheus-eks.libsonnet b/jsonnet/kube-prometheus/kube-prometheus-eks.libsonnet index d04a3eedb51096b1620cd9b6b9a853d61fee2226..1c21a93a84ccc1cd2fff101d4364e4b900571179 100644 --- a/jsonnet/kube-prometheus/kube-prometheus-eks.libsonnet +++ b/jsonnet/kube-prometheus/kube-prometheus-eks.libsonnet @@ -3,6 +3,12 @@ local service = k.core.v1.service; local servicePort = k.core.v1.service.mixin.spec.portsType; { + _config+:: { + eks: { + minimumAvailableIPs: 10, + minimumAvailableIPsTime: '10m' + } + } prometheus+: { serviceMonitorCoreDNS+: { spec+: { @@ -59,14 +65,14 @@ local servicePort = k.core.v1.service.mixin.spec.portsType; name: 'kube-prometheus-eks.rules', rules: [ { - expr: 'sum by(instance) (awscni_total_ip_addresses) - sum by(instance) (awscni_assigned_ip_addresses) < 10', + expr: 'sum by(instance) (awscni_total_ip_addresses) - sum by(instance) (awscni_assigned_ip_addresses) < %s' % $._config.eks.minimumAvailableIPs, labels: { severity: 'critical', }, annotations: { message: 'Instance {{ $labels.instance }} has less than 10 IPs available.' }, - 'for': '10m', + 'for': $._config.eks.minimumAvailableIPsTime, alert: 'EksAvailableIPs' }, ],