From 659671ce9daf3d917651d668aa067af3c29b43d5 Mon Sep 17 00:00:00 2001 From: Kaveesh Dubey Date: Mon, 5 Jun 2023 17:40:47 -0700 Subject: [PATCH 1/3] fix: Upgrades Kube state - image from: `v2.8.1` to:`v2.9.2`; chart from:`4.32.0` to `5.7.0` --- .pipelines/azure-pipeline-build.yml | 2 +- RELEASENOTES.md | 4 ++++ .../templates/ama-metrics-ksm-clusterrolebinding.yaml | 2 +- .../templates/ama-metrics-ksm-deployment.yaml | 4 ++-- .../templates/ama-metrics-ksm-role.yaml | 2 +- .../templates/ama-metrics-ksm-service.yaml | 2 +- .../templates/ama-metrics-ksm-serviceaccount.yaml | 2 +- .../azure-monitor-metrics-addon/values-template.yaml | 4 ++-- .../deploy/chart/prometheus-collector/Chart-template.yaml | 2 +- .../deploy/dependentcharts/kube-state-metrics/Chart.yaml | 4 ++-- .../deploy/dependentcharts/kube-state-metrics/values.yaml | 2 +- 11 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.pipelines/azure-pipeline-build.yml b/.pipelines/azure-pipeline-build.yml index 051a5c22..e45ff787 100644 --- a/.pipelines/azure-pipeline-build.yml +++ b/.pipelines/azure-pipeline-build.yml @@ -19,7 +19,7 @@ variables: MCR_REPOSITORY: '/azuremonitor/containerinsights/cidev/prometheus-collector/images' MCR_REPOSITORY_HELM: '/azuremonitor/containerinsights/cidev/prometheus-collector' MCR_REPOSITORY_HELM_DEPENDENCIES: '/azuremonitor/containerinsights/cidev' - KUBE_STATE_METRICS_IMAGE: 'mcr.microsoft.com/oss/kubernetes/kube-state-metrics:v2.8.1' + KUBE_STATE_METRICS_IMAGE: 'mcr.microsoft.com/oss/kubernetes/kube-state-metrics:v2.9.2' NODE_EXPORTER_IMAGE: 'mcr.microsoft.com/oss/prometheus/node-exporter:v1.5.0' IS_PR: $[eq(variables['Build.Reason'], 'PullRequest')] IS_MAIN_BRANCH: $[eq(variables['Build.SourceBranchName'], 'main')] diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 57efd092..5b86e5c3 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -1,5 +1,9 @@ # Azure Monitor Metrics for AKS clusters +## Pending + +* fix: Upgrades Kube state - image from: `v2.8.1` to:`v2.9.2`; chart from:`4.32.0` to `5.7.0` + ## Release 06-02-2023 * Linux image - `mcr.microsoft.com/azuremonitor/containerinsights/ciprod/prometheus-collector/images:6.7.1-main-06-02-2023-d384b035` * Windows image - `mcr.microsoft.com/azuremonitor/containerinsights/ciprod/prometheus-collector/images:6.7.1-main-06-02-2023-d384b035-win` diff --git a/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-ksm-clusterrolebinding.yaml b/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-ksm-clusterrolebinding.yaml index 35918977..b68b5d65 100644 --- a/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-ksm-clusterrolebinding.yaml +++ b/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-ksm-clusterrolebinding.yaml @@ -5,7 +5,7 @@ metadata: app.kubernetes.io/component: ama-metrics app.kubernetes.io/name: ama-metrics-ksm app.kubernetes.io/part-of: ama-metrics-ksm - app.kubernetes.io/version: 2.8.1 + app.kubernetes.io/version: 2.9.2 helm.sh/chart: azure-monitor-metrics-addon-0.1.0 name: ama-metrics-ksm roleRef: diff --git a/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-ksm-deployment.yaml b/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-ksm-deployment.yaml index b19e59ce..76908aa5 100644 --- a/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-ksm-deployment.yaml +++ b/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-ksm-deployment.yaml @@ -7,7 +7,7 @@ metadata: app.kubernetes.io/component: ama-metrics app.kubernetes.io/name: ama-metrics-ksm app.kubernetes.io/part-of: ama-metrics-ksm - app.kubernetes.io/version: 2.8.1 + app.kubernetes.io/version: 2.9.2 helm.sh/chart: azure-monitor-metrics-addon-0.1.0 spec: selector: @@ -21,7 +21,7 @@ spec: app.kubernetes.io/component: ama-metrics app.kubernetes.io/name: ama-metrics-ksm app.kubernetes.io/part-of: ama-metrics-ksm - app.kubernetes.io/version: 2.8.1 + app.kubernetes.io/version: 2.9.2 helm.sh/chart: azure-monitor-metrics-addon-0.1.0 annotations: cluster-autoscaler.kubernetes.io/safe-to-evict: "true" diff --git a/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-ksm-role.yaml b/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-ksm-role.yaml index 60e9c088..5295859e 100644 --- a/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-ksm-role.yaml +++ b/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-ksm-role.yaml @@ -5,7 +5,7 @@ metadata: app.kubernetes.io/component: ama-metrics app.kubernetes.io/name: ama-metrics-ksm app.kubernetes.io/part-of: ama-metrics-ksm - app.kubernetes.io/version: 2.8.1 + app.kubernetes.io/version: 2.9.2 helm.sh/chart: azure-monitor-metrics-addon-0.1.0 name: ama-metrics-ksm rules: diff --git a/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-ksm-service.yaml b/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-ksm-service.yaml index ace8410d..29accb7a 100644 --- a/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-ksm-service.yaml +++ b/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-ksm-service.yaml @@ -7,7 +7,7 @@ metadata: app.kubernetes.io/component: ama-metrics app.kubernetes.io/name: ama-metrics-ksm app.kubernetes.io/part-of: ama-metrics-ksm - app.kubernetes.io/version: 2.8.1 + app.kubernetes.io/version: 2.9.2 helm.sh/chart: azure-monitor-metrics-addon-0.1.0 annotations: prometheus.io/scrape: 'true' diff --git a/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-ksm-serviceaccount.yaml b/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-ksm-serviceaccount.yaml index 2500c3e3..ba9dbb37 100644 --- a/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-ksm-serviceaccount.yaml +++ b/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/templates/ama-metrics-ksm-serviceaccount.yaml @@ -5,7 +5,7 @@ metadata: app.kubernetes.io/component: ama-metrics app.kubernetes.io/name: ama-metrics-ksm app.kubernetes.io/part-of: ama-metrics-ksm - app.kubernetes.io/version: 2.8.1 + app.kubernetes.io/version: 2.9.2 helm.sh/chart: azure-monitor-metrics-addon-0.1.0 name: ama-metrics-ksm namespace: kube-system diff --git a/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/values-template.yaml b/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/values-template.yaml index 95b805e0..18d7506b 100644 --- a/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/values-template.yaml +++ b/otelcollector/deploy/addon-chart/azure-monitor-metrics-addon/values-template.yaml @@ -4,8 +4,8 @@ AzureMonitorMetrics: #MetricLabelsAllowlist: "testlabel=[.*]" #MetricAnnotationsAllowList: "" ImageRepository: "/oss/kubernetes/kube-state-metrics" -# Kube-state-metrics ImageTag - 2.8.1, corresponds to chart version - 4.32.0 - ImageTag: "v2.8.1" +# Kube-state-metrics ImageTag - 2.9.2, corresponds to chart version - 5.7.0 + ImageTag: "v2.9.2" Collectors: - certificatesigningrequests - configmaps diff --git a/otelcollector/deploy/chart/prometheus-collector/Chart-template.yaml b/otelcollector/deploy/chart/prometheus-collector/Chart-template.yaml index 336f8dee..4b17e67a 100644 --- a/otelcollector/deploy/chart/prometheus-collector/Chart-template.yaml +++ b/otelcollector/deploy/chart/prometheus-collector/Chart-template.yaml @@ -25,7 +25,7 @@ appVersion: "${IMAGE_TAG}" kubeVersion: ">=1.16.0-0" dependencies: - name: kube-state-metrics - version: "4.32.0" + version: "5.7.0" repository: oci://${MCR_REGISTRY}${MCR_REPOSITORY_HELM_DEPENDENCIES} condition: scrapeTargets.kubeState - name: prometheus-node-exporter diff --git a/otelcollector/deploy/dependentcharts/kube-state-metrics/Chart.yaml b/otelcollector/deploy/dependentcharts/kube-state-metrics/Chart.yaml index ea8f182a..5579b220 100644 --- a/otelcollector/deploy/dependentcharts/kube-state-metrics/Chart.yaml +++ b/otelcollector/deploy/dependentcharts/kube-state-metrics/Chart.yaml @@ -7,8 +7,8 @@ keywords: - prometheus - kubernetes type: application -version: 4.32.0 -appVersion: 2.8.1 +version: 5.7.0 +appVersion: 2.9.2 home: https://github.com/kubernetes/kube-state-metrics/ sources: - https://github.com/kubernetes/kube-state-metrics/ diff --git a/otelcollector/deploy/dependentcharts/kube-state-metrics/values.yaml b/otelcollector/deploy/dependentcharts/kube-state-metrics/values.yaml index 80f90ddb..ac8da89c 100644 --- a/otelcollector/deploy/dependentcharts/kube-state-metrics/values.yaml +++ b/otelcollector/deploy/dependentcharts/kube-state-metrics/values.yaml @@ -2,7 +2,7 @@ prometheusScrape: true image: repository: mcr.microsoft.com/oss/kubernetes/kube-state-metrics - tag: v2.8.1 + tag: v2.9.2 sha: "" pullPolicy: IfNotPresent From 1de6c2236b36e99399f538b59915e325a15c0e2e Mon Sep 17 00:00:00 2001 From: Kaveesh Dubey Date: Mon, 5 Jun 2023 22:36:46 -0700 Subject: [PATCH 2/3] build pipeline --- .pipelines/azure-pipeline-build.yml | 1 + internal/docs/UpgradeDependencies.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.pipelines/azure-pipeline-build.yml b/.pipelines/azure-pipeline-build.yml index e45ff787..04b2e5fe 100644 --- a/.pipelines/azure-pipeline-build.yml +++ b/.pipelines/azure-pipeline-build.yml @@ -2,6 +2,7 @@ trigger: branches: include: - main + - kaveesh/update_ksm pr: autoCancel: true diff --git a/internal/docs/UpgradeDependencies.md b/internal/docs/UpgradeDependencies.md index fa061a0e..b56786f5 100644 --- a/internal/docs/UpgradeDependencies.md +++ b/internal/docs/UpgradeDependencies.md @@ -4,7 +4,7 @@ Example PR: https://github.com/Azure/prometheus-collector/pull/418 Updating KSM and NE charts 1. For updating the charts for KSM and NE, replace the respective folders from here respectively under dependentcharts, [KSM](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-state-metrics) and [NE](https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus-node-exporter). -2. Update the Version and Appversion in all the yaml files for both 1p and addon charts from the example PR above. +2. Update the Version and Appversion in all the yaml files for both 1p and addon charts from the example PR above. (Note : The appversion corresponds to the Version in the kube-state-metrics chart and the version to the appversion) 3. Update both the images in our pipeline build file : azure-pipeline-build.yml For upgrading all other dependencies, update them in setup.sh (for linux) and setup.ps1(for win). From 291949d3ee259644c082ed8910aaa297c2cc8175 Mon Sep 17 00:00:00 2001 From: Kaveesh Dubey Date: Tue, 6 Jun 2023 09:58:00 -0700 Subject: [PATCH 3/3] revert and update readme --- .pipelines/azure-pipeline-build.yml | 1 - internal/docs/UpgradeDependencies.md | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pipelines/azure-pipeline-build.yml b/.pipelines/azure-pipeline-build.yml index 04b2e5fe..e45ff787 100644 --- a/.pipelines/azure-pipeline-build.yml +++ b/.pipelines/azure-pipeline-build.yml @@ -2,7 +2,6 @@ trigger: branches: include: - main - - kaveesh/update_ksm pr: autoCancel: true diff --git a/internal/docs/UpgradeDependencies.md b/internal/docs/UpgradeDependencies.md index b56786f5..3e39371c 100644 --- a/internal/docs/UpgradeDependencies.md +++ b/internal/docs/UpgradeDependencies.md @@ -4,8 +4,9 @@ Example PR: https://github.com/Azure/prometheus-collector/pull/418 Updating KSM and NE charts 1. For updating the charts for KSM and NE, replace the respective folders from here respectively under dependentcharts, [KSM](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-state-metrics) and [NE](https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus-node-exporter). -2. Update the Version and Appversion in all the yaml files for both 1p and addon charts from the example PR above. (Note : The appversion corresponds to the Version in the kube-state-metrics chart and the version to the appversion) +2. Update the Version and Appversion in all the yaml files for both 1p and addon charts from the example PR above. (Note: The version and appversion values can be found [here](https://github.com/prometheus-community/helm-charts/blob/main/charts/kube-state-metrics/Chart.yaml)) 3. Update both the images in our pipeline build file : azure-pipeline-build.yml +4. Run the Github Action [build-and-push-dependent-helm-chart](https://github.com/Azure/prometheus-collector/actions/workflows/build-and-push-dependent-helm-charts.yml) for getting PR build to succeed. For upgrading all other dependencies, update them in setup.sh (for linux) and setup.ps1(for win).