Skip to content

Commit

Permalink
Merge branch 'prometheus-operator:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
ashish1099 authored Sep 8, 2022
2 parents 2ce748b + 0a07367 commit 71d51a7
Show file tree
Hide file tree
Showing 51 changed files with 334 additions and 170 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/support.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ labels: kind/support
---

This repository now has the new GitHub Discussions enabled:
https://github.com/coreos/kube-prometheus/discussions
https://github.com/prometheus-operator/kube-prometheus/discussions

Please create a new discussion to ask for any kind of support, which is not a Bug or Feature Request.

Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,13 @@ Though for a quickstart a compiled version of the Kubernetes [manifests](manifes

```shell
# Create the namespace and CRDs, and then wait for them to be available before creating the remaining resources
# Note that due to some CRD size we are using kubectl server-side apply feature which is generally available since kubernetes 1.22.
# Note that due to some CRD size we are using kubectl server-side apply feature which is generally available since kubernetes 1.22.
# If you are using previous kubernetes versions this feature may not be available and you would need to use kubectl create instead.
kubectl apply --server-side -f manifests/setup
until kubectl get servicemonitors --all-namespaces ; do date; sleep 1; echo ""; done
kubectl wait \
--for condition=Established \
--all CustomResourceDefinition \
--namespace=monitoring
kubectl apply -f manifests/
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ function(params) (import 'github.com/kubernetes/kube-state-metrics/jsonnet/kube-
action: 'labeldrop',
},
],
metricRelabelings: [
{
// Dropping metric deprecated from kube-state-metrics 2.6.0 version
sourceLabels: ['__name__'],
regex: 'kube_endpoint_address_not_ready|kube_endpoint_address_available',
action: 'drop',
},
],
tlsConfig: {
insecureSkipVerify: true,
},
Expand Down
13 changes: 7 additions & 6 deletions jsonnet/kube-prometheus/components/prometheus-adapter.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ local defaults = {
nodeExporter: '4m',
windowsExporter: '4m',
},
containerMetricsPrefix:: '',

prometheusURL:: error 'must provide prometheusURL',
config:: {
Expand All @@ -39,10 +40,10 @@ local defaults = {
containerQuery: |||
sum by (<<.GroupBy>>) (
irate (
container_cpu_usage_seconds_total{<<.LabelMatchers>>,container!="",pod!=""}[%(kubelet)s]
%(containerMetricsPrefix)scontainer_cpu_usage_seconds_total{<<.LabelMatchers>>,container!="",pod!=""}[%(kubelet)s]
)
)
||| % $.rangeIntervals,
||| % { kubelet: $.rangeIntervals.kubelet, containerMetricsPrefix: $.containerMetricsPrefix },
nodeQuery: |||
sum by (<<.GroupBy>>) (
1 - irate(
Expand All @@ -57,7 +58,7 @@ local defaults = {
windows_cpu_time_total{mode="idle", job="windows-exporter",<<.LabelMatchers>>}[%(windowsExporter)s]
)
)
||| % $.rangeIntervals,
||| % { nodeExporter: $.rangeIntervals.nodeExporter, windowsExporter: $.rangeIntervals.windowsExporter, containerMetricsPrefix: $.containerMetricsPrefix },
resources: {
overrides: {
node: { resource: 'node' },
Expand All @@ -70,9 +71,9 @@ local defaults = {
memory: {
containerQuery: |||
sum by (<<.GroupBy>>) (
container_memory_working_set_bytes{<<.LabelMatchers>>,container!="",pod!=""}
%(containerMetricsPrefix)scontainer_memory_working_set_bytes{<<.LabelMatchers>>,container!="",pod!=""}
)
|||,
||| % { containerMetricsPrefix: $.containerMetricsPrefix },
nodeQuery: |||
sum by (<<.GroupBy>>) (
node_memory_MemTotal_bytes{job="node-exporter",<<.LabelMatchers>>}
Expand All @@ -84,7 +85,7 @@ local defaults = {
-
windows_memory_available_bytes{job="windows-exporter",<<.LabelMatchers>>}
)
|||,
||| % { containerMetricsPrefix: $.containerMetricsPrefix },
resources: {
overrides: {
instance: { resource: 'node' },
Expand Down
2 changes: 1 addition & 1 deletion jsonnet/kube-prometheus/main.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ local utils = import './lib/utils.libsonnet';
kubeStateMetrics: 'k8s.gcr.io/kube-state-metrics/kube-state-metrics:v' + $.values.common.versions.kubeStateMetrics,
nodeExporter: 'quay.io/prometheus/node-exporter:v' + $.values.common.versions.nodeExporter,
prometheus: 'quay.io/prometheus/prometheus:v' + $.values.common.versions.prometheus,
prometheusAdapter: 'k8s.gcr.io/prometheus-adapter/prometheus-adapter:v' + $.values.common.versions.prometheusAdapter,
prometheusAdapter: 'registry.k8s.io/prometheus-adapter/prometheus-adapter:v' + $.values.common.versions.prometheusAdapter,
prometheusOperator: 'quay.io/prometheus-operator/prometheus-operator:v' + $.values.common.versions.prometheusOperator,
prometheusOperatorReloader: 'quay.io/prometheus-operator/prometheus-config-reloader:v' + $.values.common.versions.prometheusOperator,
kubeRbacProxy: 'quay.io/brancz/kube-rbac-proxy:v' + $.values.common.versions.kubeRbacProxy,
Expand Down
8 changes: 4 additions & 4 deletions jsonnet/kube-prometheus/versions.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"alertmanager": "0.24.0",
"blackboxExporter": "0.22.0",
"grafana": "9.1.0",
"kubeStateMetrics": "2.5.0",
"grafana": "9.1.2",
"kubeStateMetrics": "2.6.0",
"nodeExporter": "1.3.1",
"prometheus": "2.38.0",
"prometheusAdapter": "0.9.1",
"prometheusOperator": "0.58.0",
"prometheusAdapter": "0.10.0",
"prometheusOperator": "0.59.0",
"kubeRbacProxy": "0.13.0",
"configmapReload": "0.5.0",
"pyrra": "0.4.4"
Expand Down
28 changes: 14 additions & 14 deletions jsonnetfile.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"subdir": "contrib/mixin"
}
},
"version": "192d635da91f0f87b7c031aedb87a75fecc01811",
"version": "4d57eb8d3b2190bfdba3c65f8eb93c0349fc6dcc",
"sum": "IkDHlaE0gvvcPjSNurFT+jQ2aCOAbqHF1WVmXbAgkds="
},
{
Expand Down Expand Up @@ -58,8 +58,8 @@
"subdir": "grafana-builder"
}
},
"version": "a2ba95acc8b7653d33bd57075678d8de2a64e5b3",
"sum": "1Ge62JmmPDq7fWyDAt3uCTobGEj4sJdbkqxRGWK22p0="
"version": "c132c4afcf17491718539db4c2d94c0ea4346120",
"sum": "tDR6yT2GVfw0wTU12iZH+m01HrbIr6g/xN+/8nzNkU0="
},
{
"source": {
Expand All @@ -68,8 +68,8 @@
"subdir": ""
}
},
"version": "b8f44bb7be728423836bef0e904ec7166895a34b",
"sum": "LCgSosxceeYuoau5fYSPtE5eXOFe46DxexfkrctUv7c="
"version": "1ddc6f6f739cc9fe4b8ac6a0fbb23cb09fe53bc3",
"sum": "0Goz56z5rF8rRarGQNj4f7VFvnsw7D7pSPUsYutt+J4="
},
{
"source": {
Expand All @@ -78,7 +78,7 @@
"subdir": "jsonnet/kube-state-metrics"
}
},
"version": "f1d56534651990ed434aac4e4dc86766d83004a4",
"version": "20ef8a759681c8ed263184f481f4b60686f300bd",
"sum": "evJ+PXRzuM1tezCG5WzpAn4Lk3YJfMvDFcs+45fsscU="
},
{
Expand All @@ -88,7 +88,7 @@
"subdir": "jsonnet/kube-state-metrics-mixin"
}
},
"version": "f1d56534651990ed434aac4e4dc86766d83004a4",
"version": "20ef8a759681c8ed263184f481f4b60686f300bd",
"sum": "u8gaydJoxEjzizQ8jY8xSjYgWooPmxw+wIWdDxifMAk="
},
{
Expand All @@ -98,7 +98,7 @@
"subdir": "jsonnet/mixin"
}
},
"version": "03b531ff8024617e07c668f5fcd19fd25cfe342c",
"version": "a63bbe70bd58fa1a59a5b22c2ffe4102beebe41f",
"sum": "GQmaVFJwKMiD/P4n3N2LrAZVcwutriWrP8joclDtBYQ=",
"name": "prometheus-operator-mixin"
},
Expand All @@ -109,8 +109,8 @@
"subdir": "jsonnet/prometheus-operator"
}
},
"version": "03b531ff8024617e07c668f5fcd19fd25cfe342c",
"sum": "hV3FK2ekNFLUlKnj5chRp8WKKxZemfbwynYWK5RkY1E="
"version": "a63bbe70bd58fa1a59a5b22c2ffe4102beebe41f",
"sum": "yyCtOZvvEmJ7jL8oogGCt89X/acej9flL588+P4g9F4="
},
{
"source": {
Expand All @@ -130,7 +130,7 @@
"subdir": "docs/node-mixin"
}
},
"version": "b43db0de6e704193b952b534c98816ba836b899e",
"version": "4ad86b349b7ffdbc30087c00a12def3254fd850b",
"sum": "tappaHscNBSJCA6ypSWt7DDhohIOkxNjcLFRb3WKpu4="
},
{
Expand All @@ -140,7 +140,7 @@
"subdir": "documentation/prometheus-mixin"
}
},
"version": "8b863c42dd956d35d18a7a0b39c89c86adf7cebf",
"version": "6767f6e1a946af41f83ca233c6fbfc94a928abee",
"sum": "crD6rsagAMJFnVRw4pO63z3LLYfz4QFIiMR14zjjIfY=",
"name": "prometheus"
},
Expand All @@ -151,7 +151,7 @@
"subdir": "config/crd/bases"
}
},
"version": "e9fbdfcd9213415bef43f762ff7bd2145a8ef930",
"version": "389fb2d2276d030a78551c472a131146f2cc0d48",
"sum": "d1550yhsX4VxdVN7b0gWT0cido/W90P6OGLzLqPwZcs="
},
{
Expand All @@ -161,7 +161,7 @@
"subdir": "mixin"
}
},
"version": "6e6a48672f95e19d7c15e5f6473702516c531c0f",
"version": "a947f33e1420d7ad4e171c4300b81a0dac1b083a",
"sum": "oksO55VdKbsLAVA3vl7b1woE9TLmfvH7sz5+1A7iOBE=",
"name": "thanos-mixin"
},
Expand Down
2 changes: 1 addition & 1 deletion manifests/grafana-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
app.kubernetes.io/component: grafana
app.kubernetes.io/name: grafana
app.kubernetes.io/part-of: kube-prometheus
app.kubernetes.io/version: 9.1.0
app.kubernetes.io/version: 9.1.2
name: grafana-config
namespace: monitoring
stringData:
Expand Down
2 changes: 1 addition & 1 deletion manifests/grafana-dashboardDatasources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
app.kubernetes.io/component: grafana
app.kubernetes.io/name: grafana
app.kubernetes.io/part-of: kube-prometheus
app.kubernetes.io/version: 9.1.0
app.kubernetes.io/version: 9.1.2
name: grafana-datasources
namespace: monitoring
stringData:
Expand Down
Loading

0 comments on commit 71d51a7

Please sign in to comment.