From e16f7cd75e84572f4fa613e55a80235cc1ee288a Mon Sep 17 00:00:00 2001 From: Terin Stock Date: Wed, 18 Sep 2019 20:18:50 -0700 Subject: [PATCH 1/5] correct mapping of hpa condition status labels The "condition" and "status" labels for the hpa status conditions were mapped to the incorrect values. This resulted in the status being in the condition label, and the condition in the status label. This changelist corrects the mapping, so that condition and status map to their respective values. kube_hpa_status_condition{condition="AbleToScale",hpa="hpa1",namespace="ns1",status="false"} 0 kube_hpa_status_condition{condition="AbleToScale",hpa="hpa1",namespace="ns1",status="true"} 1 kube_hpa_status_condition{condition="AbleToScale",hpa="hpa1",namespace="ns1",status="unknown"} 0 Fixes: f9658ca ("Add hpa conditions") Signed-off-by: Terin Stock (cherry picked from commit 6b09c5eb7d671c5faa7ef91a07ebc88bfb5ad9d1) --- docs/horizontalpodautoscaler-metrics.md | 2 +- internal/store/hpa.go | 2 +- internal/store/hpa_test.go | 16 ++++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/horizontalpodautoscaler-metrics.md b/docs/horizontalpodautoscaler-metrics.md index 3c77ebd178..0b4c1cc773 100644 --- a/docs/horizontalpodautoscaler-metrics.md +++ b/docs/horizontalpodautoscaler-metrics.md @@ -7,5 +7,5 @@ | kube_hpa_spec_min_replicas | Gauge | `hpa`=<hpa-name>
`namespace`=<hpa-namespace> | STABLE | | kube_hpa_status_current_replicas | Gauge | `hpa`=<hpa-name>
`namespace`=<hpa-namespace> | STABLE | | kube_hpa_status_desired_replicas | Gauge | `hpa`=<hpa-name>
`namespace`=<hpa-namespace> | STABLE | -| kube_hpa_status_condition | Gauge | `hpa`=<hpa-name>
`namespace`=<hpa-namespace> | STABLE | +| kube_hpa_status_condition | Gauge | `hpa`=<hpa-name>
`namespace`=<hpa-namespace>
`condition`=<hpa-condition>
`status`=<true\|false\|unknown> | STABLE | | kube_hpa_labels | Gauge | `hpa`=<hpa-name>
`namespace`=<hpa-namespace> | STABLE | diff --git a/internal/store/hpa.go b/internal/store/hpa.go index 1a59d822b4..08a949c29b 100644 --- a/internal/store/hpa.go +++ b/internal/store/hpa.go @@ -133,7 +133,7 @@ var ( for j, m := range metrics { metric := m metric.LabelKeys = []string{"condition", "status"} - metric.LabelValues = append(metric.LabelValues, string(c.Type)) + metric.LabelValues = append([]string{string(c.Type)}, metric.LabelValues...) ms[i*len(conditionStatuses)+j] = metric } } diff --git a/internal/store/hpa_test.go b/internal/store/hpa_test.go index c1e35fe473..fcea8f65c4 100644 --- a/internal/store/hpa_test.go +++ b/internal/store/hpa_test.go @@ -44,10 +44,10 @@ func TestHPAStore(t *testing.T) { # TYPE kube_hpa_status_current_replicas gauge # HELP kube_hpa_status_desired_replicas Desired number of replicas of pods managed by this autoscaler. # TYPE kube_hpa_status_desired_replicas gauge - # HELP kube_hpa_status_condition The condition of this autoscaler. - # TYPE kube_hpa_status_condition gauge - # HELP kube_hpa_labels Kubernetes labels converted to Prometheus labels. - # TYPE kube_hpa_labels gauge + # HELP kube_hpa_status_condition The condition of this autoscaler. + # TYPE kube_hpa_status_condition gauge + # HELP kube_hpa_labels Kubernetes labels converted to Prometheus labels. + # TYPE kube_hpa_labels gauge ` cases := []generateMetricsTestCase{ { @@ -82,13 +82,13 @@ func TestHPAStore(t *testing.T) { }, }, Want: metadata + ` - kube_hpa_labels{hpa="hpa1",label_app="foobar",namespace="ns1"} 1 + kube_hpa_labels{hpa="hpa1",label_app="foobar",namespace="ns1"} 1 kube_hpa_metadata_generation{hpa="hpa1",namespace="ns1"} 2 kube_hpa_spec_max_replicas{hpa="hpa1",namespace="ns1"} 4 kube_hpa_spec_min_replicas{hpa="hpa1",namespace="ns1"} 2 - kube_hpa_status_condition{condition="false",hpa="hpa1",namespace="ns1",status="AbleToScale"} 0 - kube_hpa_status_condition{condition="true",hpa="hpa1",namespace="ns1",status="AbleToScale"} 1 - kube_hpa_status_condition{condition="unknown",hpa="hpa1",namespace="ns1",status="AbleToScale"} 0 + kube_hpa_status_condition{condition="AbleToScale",hpa="hpa1",namespace="ns1",status="false"} 0 + kube_hpa_status_condition{condition="AbleToScale",hpa="hpa1",namespace="ns1",status="true"} 1 + kube_hpa_status_condition{condition="AbleToScale",hpa="hpa1",namespace="ns1",status="unknown"} 0 kube_hpa_status_current_replicas{hpa="hpa1",namespace="ns1"} 2 kube_hpa_status_desired_replicas{hpa="hpa1",namespace="ns1"} 2 `, From 47181f54178898f13ac8904ca3509b52cb3f3504 Mon Sep 17 00:00:00 2001 From: Tariq Ibrahim Date: Mon, 23 Sep 2019 14:16:12 -0700 Subject: [PATCH 2/5] *: cut v1.8.0-rc.1 --- CHANGELOG.md | 14 ++++++++++++++ README.md | 2 +- VERSION | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb00587284..49249d64de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## v1.8.0-rc.1 / 2019-09-24 + +* [CHANGE] Pin go version to go mod artifact file #882 +* [BUGFIX] Correct mapping of hpa condition status labels #890 + +## v1.8.0-rc.0 / 2019-09-10 + +* [FEATURE] Introduce sharding (and experimental auto-sharding) #613 +* [FEATURE] Add `kube_pod_status_unschedulable metric` #835 +* [CHANGE] Makefile: Remove tmpdir after container build #867 +* [ENHANCEMENT] Add list/watch success/error count total metrics #866 +* [FEATURE] Add `kube_node_role metric` #877 +* [ENHANCEMENT] Add support for Darwin OS in e2e test #879 + ## v1.7.2 / 2019-08-05 * [CHANGE] Revert "add `kube_*_annotations metrics` for all objects" #859 diff --git a/README.md b/README.md index 3c3fac444d..27ce372c29 100644 --- a/README.md +++ b/README.md @@ -61,11 +61,11 @@ At most, 5 kube-state-metrics and 5 [kubernetes releases](https://github.com/kub | kube-state-metrics | client-go | **Kubernetes 1.11** | **Kubernetes 1.12** | **Kubernetes 1.13** | **Kubernetes 1.14** | **Kubernetes 1.15** | |--------------------|------------|---------------------|---------------------|---------------------|---------------------|----------------------| -| **v1.3.1** | v6.0.0 | ✓ | ✓ | - | - | - | | **v1.4.0** | v8.0.0 | ✓ | ✓ | - | - | - | | **v1.5.0** | v8.0.0 | ✓ | ✓ | - | - | - | | **v1.6.0** | v11.0.0 | ✓ | ✓ | ✓ | ✓ | - | | **v1.7.2** | v12.0.0 | ✓ | ✓ | ✓ | ✓ | ✓ | +| **v1.8.0-rc.1** | v12.0.0 | ✓ | ✓ | ✓ | ✓ | ✓ | | **master** | v12.0.0 | ✓ | ✓ | ✓ | ✓ | ✓ | - `✓` Fully supported version range. - `-` The Kubernetes cluster has features the client-go library can't use (additional API objects, etc). diff --git a/VERSION b/VERSION index f8a696c8dc..cd04bcbded 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.7.2 +1.8.0-rc.1 From 676fd6904d25d21473778b1cba3332ece0e91cec Mon Sep 17 00:00:00 2001 From: Frederic Branczyk Date: Tue, 10 Sep 2019 06:56:26 -0700 Subject: [PATCH 3/5] *: cut v1.8.0-rc.0 (cherry picked from commit 89d2f9d66a6e2a1c285e63cc3f9ead3a77094aab) --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49249d64de..70206daf78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ * [FEATURE] Introduce sharding (and experimental auto-sharding) #613 * [FEATURE] Add `kube_pod_status_unschedulable metric` #835 * [CHANGE] Makefile: Remove tmpdir after container build #867 -* [ENHANCEMENT] Add list/watch success/error count total metrics #866 +* [ENHANCEMENT] Add metrics about kube-state-metric's interaction with the Kubernetes API. #866 * [FEATURE] Add `kube_node_role metric` #877 * [ENHANCEMENT] Add support for Darwin OS in e2e test #879 From c84b82f2d14c62eb6f3ea3ba0a6795663d189981 Mon Sep 17 00:00:00 2001 From: Tariq Ibrahim Date: Thu, 26 Sep 2019 08:46:37 -0700 Subject: [PATCH 4/5] update k8s manifests to point to 1.8.0-rc.1 --- kubernetes/autosharding/kube-state-metrics-statefulset.yaml | 2 +- kubernetes/kube-state-metrics-deployment.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kubernetes/autosharding/kube-state-metrics-statefulset.yaml b/kubernetes/autosharding/kube-state-metrics-statefulset.yaml index 2fd0f9ba12..7be3bab5d5 100644 --- a/kubernetes/autosharding/kube-state-metrics-statefulset.yaml +++ b/kubernetes/autosharding/kube-state-metrics-statefulset.yaml @@ -19,7 +19,7 @@ spec: serviceAccountName: kube-state-metrics containers: - name: kube-state-metrics - image: quay.io/coreos/kube-state-metrics:v1.7.1 + image: quay.io/coreos/kube-state-metrics:v1.8.0-rc.1 args: - "--pod=$(POD_NAME)" - "--pod-namespace=$(POD_NAMESPACE)" diff --git a/kubernetes/kube-state-metrics-deployment.yaml b/kubernetes/kube-state-metrics-deployment.yaml index a5d23d676c..4e6681e6f4 100644 --- a/kubernetes/kube-state-metrics-deployment.yaml +++ b/kubernetes/kube-state-metrics-deployment.yaml @@ -18,7 +18,7 @@ spec: serviceAccountName: kube-state-metrics containers: - name: kube-state-metrics - image: quay.io/coreos/kube-state-metrics:v1.7.2 + image: quay.io/coreos/kube-state-metrics:v1.8.0-rc.1 ports: - name: http-metrics containerPort: 8080 From 41a888af004aa96a59ec84789da187b4b4afb05c Mon Sep 17 00:00:00 2001 From: Tariq Ibrahim Date: Tue, 1 Oct 2019 06:49:43 -0700 Subject: [PATCH 5/5] *: cut v1.8.0 --- CHANGELOG.md | 4 ++++ README.md | 6 +++--- VERSION | 2 +- kubernetes/autosharding/kube-state-metrics-statefulset.yaml | 2 +- kubernetes/kube-state-metrics-deployment.yaml | 2 +- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 70206daf78..52742f7d47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v1.8.0 / 2019-10-01 + +After a testing period of 7 days, there were no additional bugs found or features introduced. + ## v1.8.0-rc.1 / 2019-09-24 * [CHANGE] Pin go version to go mod artifact file #882 diff --git a/README.md b/README.md index 27ce372c29..d72bf4bff8 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ At most, 5 kube-state-metrics and 5 [kubernetes releases](https://github.com/kub | **v1.5.0** | v8.0.0 | ✓ | ✓ | - | - | - | | **v1.6.0** | v11.0.0 | ✓ | ✓ | ✓ | ✓ | - | | **v1.7.2** | v12.0.0 | ✓ | ✓ | ✓ | ✓ | ✓ | -| **v1.8.0-rc.1** | v12.0.0 | ✓ | ✓ | ✓ | ✓ | ✓ | +| **v1.8.0** | v12.0.0 | ✓ | ✓ | ✓ | ✓ | ✓ | | **master** | v12.0.0 | ✓ | ✓ | ✓ | ✓ | ✓ | - `✓` Fully supported version range. - `-` The Kubernetes cluster has features the client-go library can't use (additional API objects, etc). @@ -78,8 +78,8 @@ release. #### Container Image The latest container image can be found at: -* `quay.io/coreos/kube-state-metrics:v1.7.2` -* `k8s.gcr.io/kube-state-metrics:v1.7.2` +* `quay.io/coreos/kube-state-metrics:v1.8.0` +* `k8s.gcr.io/kube-state-metrics:v1.8.0` **Note**: The recommended docker registry for kube-state-metrics is `quay.io`. kube-state-metrics on diff --git a/VERSION b/VERSION index cd04bcbded..27f9cd322b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.8.0-rc.1 +1.8.0 diff --git a/kubernetes/autosharding/kube-state-metrics-statefulset.yaml b/kubernetes/autosharding/kube-state-metrics-statefulset.yaml index 7be3bab5d5..fd905eaec9 100644 --- a/kubernetes/autosharding/kube-state-metrics-statefulset.yaml +++ b/kubernetes/autosharding/kube-state-metrics-statefulset.yaml @@ -19,7 +19,7 @@ spec: serviceAccountName: kube-state-metrics containers: - name: kube-state-metrics - image: quay.io/coreos/kube-state-metrics:v1.8.0-rc.1 + image: quay.io/coreos/kube-state-metrics:v1.8.0 args: - "--pod=$(POD_NAME)" - "--pod-namespace=$(POD_NAMESPACE)" diff --git a/kubernetes/kube-state-metrics-deployment.yaml b/kubernetes/kube-state-metrics-deployment.yaml index 4e6681e6f4..5fe3f01f95 100644 --- a/kubernetes/kube-state-metrics-deployment.yaml +++ b/kubernetes/kube-state-metrics-deployment.yaml @@ -18,7 +18,7 @@ spec: serviceAccountName: kube-state-metrics containers: - name: kube-state-metrics - image: quay.io/coreos/kube-state-metrics:v1.8.0-rc.1 + image: quay.io/coreos/kube-state-metrics:v1.8.0 ports: - name: http-metrics containerPort: 8080