Skip to content

Commit

Permalink
OCPBUGS-35095: sync k-mixin with upstream
Browse files Browse the repository at this point in the history
Also drop redundant KSM selector from KubeCPUOvercommit.

Signed-off-by: Pranshu Srivastava <[email protected]>
  • Loading branch information
rexagod committed Nov 4, 2024
1 parent ddf149a commit 1a14258
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 30 deletions.
14 changes: 10 additions & 4 deletions assets/control-plane/prometheus-rule.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ spec:
summary: StatefulSet update has not been rolled out.
expr: |
(
max without (revision) (
max by(namespace, statefulset, job, cluster) (
kube_statefulset_status_current_revision{namespace=~"(openshift-.*|kube-.*|default)",job="kube-state-metrics"}
unless
kube_statefulset_status_update_revision{namespace=~"(openshift-.*|kube-.*|default)",job="kube-state-metrics"}
Expand Down Expand Up @@ -232,7 +232,7 @@ spec:
description: Cluster {{ $labels.cluster }} has overcommitted CPU resource requests for Pods by {{ $value }} CPU shares and cannot tolerate node failure.
summary: Cluster has overcommitted CPU resource requests.
expr: |
sum(namespace_cpu:kube_pod_container_resource_requests:sum{job="kube-state-metrics",}) by (cluster) - (sum(kube_node_status_allocatable{job="kube-state-metrics",resource="cpu"}) by (cluster) - max(kube_node_status_allocatable{job="kube-state-metrics",resource="cpu"}) by (cluster)) > 0
sum(namespace_cpu:kube_pod_container_resource_requests:sum{}) by (cluster) - (sum(kube_node_status_allocatable{job="kube-state-metrics",resource="cpu"}) by (cluster) - max(kube_node_status_allocatable{job="kube-state-metrics",resource="cpu"}) by (cluster)) > 0
and
(sum(kube_node_status_allocatable{job="kube-state-metrics",resource="cpu"}) by (cluster) - max(kube_node_status_allocatable{job="kube-state-metrics",resource="cpu"}) by (cluster)) > 0
for: 10m
Expand Down Expand Up @@ -336,7 +336,7 @@ spec:
description: The kubernetes apiserver has terminated {{ $value | humanizePercentage }} of its incoming requests.
summary: The kubernetes apiserver has terminated {{ $value | humanizePercentage }} of its incoming requests.
expr: |
sum(rate(apiserver_request_terminations_total{job="apiserver"}[10m])) / ( sum(rate(apiserver_request_total{job="apiserver"}[10m])) + sum(rate(apiserver_request_terminations_total{job="apiserver"}[10m])) ) > 0.20
sum by(cluster) (rate(apiserver_request_terminations_total{job="apiserver"}[10m])) / ( sum by(cluster) (rate(apiserver_request_total{job="apiserver"}[10m])) + sum by(cluster) (rate(apiserver_request_terminations_total{job="apiserver"}[10m])) ) > 0.20
for: 5m
labels:
severity: warning
Expand Down Expand Up @@ -477,7 +477,7 @@ spec:
max by(cluster, namespace, pod, node) (kube_pod_info{node!=""})
)
record: node_namespace_pod_container:container_memory_swap
- name: k8s.rules.container_resource
- name: k8s.rules.container_memory_requests
rules:
- expr: |
kube_pod_container_resource_requests{resource="memory",job="kube-state-metrics"} * on (namespace, pod, cluster)
Expand All @@ -496,6 +496,8 @@ spec:
)
)
record: namespace_memory:kube_pod_container_resource_requests:sum
- name: k8s.rules.container_cpu_requests
rules:
- expr: |
kube_pod_container_resource_requests{resource="cpu",job="kube-state-metrics"} * on (namespace, pod, cluster)
group_left() max by (namespace, pod, cluster) (
Expand All @@ -513,6 +515,8 @@ spec:
)
)
record: namespace_cpu:kube_pod_container_resource_requests:sum
- name: k8s.rules.container_memory_limits
rules:
- expr: |
kube_pod_container_resource_limits{resource="memory",job="kube-state-metrics"} * on (namespace, pod, cluster)
group_left() max by (namespace, pod, cluster) (
Expand All @@ -530,6 +534,8 @@ spec:
)
)
record: namespace_memory:kube_pod_container_resource_limits:sum
- name: k8s.rules.container_cpu_limits
rules:
- expr: |
kube_pod_container_resource_limits{resource="cpu",job="kube-state-metrics"} * on (namespace, pod, cluster)
group_left() max by (namespace, pod, cluster) (
Expand Down
3 changes: 1 addition & 2 deletions jsonnet/jsonnetfile.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,13 @@
"version": "main"
},
{
"name": "kubernetes-mixin is pinned because newer versions are breaking MON-3837",
"source": {
"git": {
"remote": "https://github.com/kubernetes-monitoring/kubernetes-mixin.git",
"subdir": ""
}
},
"version": "b247371d1780f530587a8d9dd04ccb19ea970ba0"
"version": "cb72d737459a655e7575c09f7859815ae3690981"
}
],
"legacyImports": true
Expand Down
47 changes: 23 additions & 24 deletions jsonnet/jsonnetfile.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"subdir": "contrib/mixin"
}
},
"version": "5704c6148d798ea444db26a966394406d8c10526",
"version": "995027f5c1363404e86f7a858ea2833df01f0954",
"sum": "IXI3LQIT9NmTPJAk8WLUJd5+qZfcGpeNCyWIK7oEpws="
},
{
Expand Down Expand Up @@ -58,8 +58,8 @@
"subdir": "gen/grafonnet-latest"
}
},
"version": "733beadbc8dab55c5fe1bcdcf0d8a2d215759a55",
"sum": "eyuJ0jOXeA4MrobbNgU4/v5a7ASDHslHZ0eS6hDdWoI="
"version": "82a19822e54a0a12a51e24dbd48fcde717dc0864",
"sum": "64fMUPI3frXGj4X1FqFd1t7r04w3CUSmXaDcJ23EYbQ="
},
{
"source": {
Expand All @@ -68,18 +68,18 @@
"subdir": "gen/grafonnet-v10.0.0"
}
},
"version": "733beadbc8dab55c5fe1bcdcf0d8a2d215759a55",
"version": "82a19822e54a0a12a51e24dbd48fcde717dc0864",
"sum": "xdcrJPJlpkq4+5LpGwN4tPAuheNNLXZjE6tDcyvFjr0="
},
{
"source": {
"git": {
"remote": "https://github.com/grafana/grafonnet.git",
"subdir": "gen/grafonnet-v11.0.0"
"subdir": "gen/grafonnet-v11.1.0"
}
},
"version": "733beadbc8dab55c5fe1bcdcf0d8a2d215759a55",
"sum": "0BvzR0i4bS4hc2O3xDv6i9m52z7mPrjvqxtcPrGhynA="
"version": "82a19822e54a0a12a51e24dbd48fcde717dc0864",
"sum": "41w7p/rwrNsITqNHMXtGSJAfAyKmnflg6rFhKBduUxM="
},
{
"source": {
Expand All @@ -88,7 +88,7 @@
"subdir": "grafana-builder"
}
},
"version": "4ad199dab450b829274234b1014ca577649b4557",
"version": "ab84b9f67c7a7f61e0c0a311afb47a1af4f5903f",
"sum": "yxqWcq/N3E/a/XreeU6EuE6X7kYPnG0AspAQFKOjASo="
},
{
Expand Down Expand Up @@ -129,9 +129,8 @@
"subdir": ""
}
},
"version": "b247371d1780f530587a8d9dd04ccb19ea970ba0",
"sum": "7M2QHK3WhOc1xT7T7KhL9iKsCYTfsIXpmcItffAcbL0=",
"name": "kubernetes-mixin is pinned because newer versions are breaking MON-3837"
"version": "cb72d737459a655e7575c09f7859815ae3690981",
"sum": "JaPnO5N/KUBgA9v6qE7CYzp8OWDTpzjM0+l/SPqL4m4="
},
{
"source": {
Expand All @@ -140,7 +139,7 @@
"subdir": "jsonnet/kube-state-metrics"
}
},
"version": "f50205a4dfc81042bb140f289a3d2bc81a7557d0",
"version": "3c6bc839119b271bf9fa86809d5b3b1421fc1d36",
"sum": "lO7jUSzAIy8Yk9pOWJIWgPRhubkWzVh56W6wtYfbVH4="
},
{
Expand All @@ -150,7 +149,7 @@
"subdir": "jsonnet/kube-state-metrics-mixin"
}
},
"version": "f50205a4dfc81042bb140f289a3d2bc81a7557d0",
"version": "3c6bc839119b271bf9fa86809d5b3b1421fc1d36",
"sum": "qclI7LwucTjBef3PkGBkKxF0mfZPbHnn4rlNWKGtR4c="
},
{
Expand All @@ -171,8 +170,8 @@
"subdir": "jsonnet/telemeter"
}
},
"version": "ecc16b6a0335b0cd57e0de0a2850763eb9e145fa",
"sum": "n4IkAE4vnL+b2TqSr0c8JDZ7jRhNrnuruUz4MyAKEfU=",
"version": "0453f452b7ca677e3be10faa95bea714733b4830",
"sum": "0m1kvO0SH4YoldGek69nhBGMTPxYz3gYcyNhfrymAOE=",
"name": "telemeter-client"
},
{
Expand All @@ -182,8 +181,8 @@
"subdir": "jsonnet/kube-prometheus"
}
},
"version": "23db41ce8b6deed1d131444108d4259c901b843d",
"sum": "t+TcSKTyuukf1RRh0y82UixlYD36LCSoxx1CRfqKvYY="
"version": "69d9636b64192418d64912c032f5437361e88ea5",
"sum": "W4HnSyscMMutOCaDyjNZy1XXcdhRPibYuV1yVgqxXm0="
},
{
"source": {
Expand All @@ -192,7 +191,7 @@
"subdir": "jsonnet/mixin"
}
},
"version": "5f3cd676e9d5407bbe9a8bcd274ee6b5c94b436a",
"version": "f4ecf80bd1051cb62a95a7c49ef228a67e5c2f45",
"sum": "gi+knjdxs2T715iIQIntrimbHRgHnpM8IFBJDD1gYfs=",
"name": "prometheus-operator-mixin"
},
Expand All @@ -213,8 +212,8 @@
"subdir": "doc/alertmanager-mixin"
}
},
"version": "e1492602209b86e0ca6d7671c7353b62a31b897b",
"sum": "IpF46ZXsm+0wJJAPtAre8+yxTNZA57mBqGpBP/r7/kw=",
"version": "ff8c09d60174f27850830ceed6be38b3cf86974b",
"sum": "Mf4h1BYLle2nrgjf/HXrBbl0Zk8N+xaoEM017o0BC+k=",
"name": "alertmanager"
},
{
Expand All @@ -224,8 +223,8 @@
"subdir": "docs/node-mixin"
}
},
"version": "71d9b6c06103a440a6590135467bc4c96174c9a1",
"sum": "rhUvbqviGjQ2mwsRhHKMN0TiS3YvnYpUXHew3XlQ+Wg="
"version": "07ee8efaa4f8e7260eb8611f3f42973cbbf8ce8f",
"sum": "cQCW+1N0Xae5yXecCWDK2oAlN0luBS/5GrwBYSlaFms="
},
{
"source": {
Expand All @@ -234,7 +233,7 @@
"subdir": "documentation/prometheus-mixin"
}
},
"version": "5037cf75f2d4f1671ad365ba1e99902fc36808d5",
"version": "4b56af7eb824d8e7dc13994b662b5c5b39928629",
"sum": "dYLcLzGH4yF3qB7OGC/7z4nqeTNjv42L7Q3BENU8XJI=",
"name": "prometheus"
},
Expand Down Expand Up @@ -266,7 +265,7 @@
"subdir": "mixin"
}
},
"version": "585899439beddde6018d9e8cfacc74d1efb5617f",
"version": "62038110b1bc47b1324b06a0f7d91c8bce680e5e",
"sum": "ieCD4eMgGbOlrI8GmckGPHBGQDcLasE1rULYq56W/bs="
}
],
Expand Down

0 comments on commit 1a14258

Please sign in to comment.