From 641ab2761984371b692302754a9e9abbd4cec396 Mon Sep 17 00:00:00 2001 From: Lari Hotari Date: Thu, 25 Jan 2024 18:18:53 +0200 Subject: [PATCH] Upgrade to kube-prometheus-stack 56.x.x --- README.md | 13 ++++++++ charts/pulsar/Chart.yaml | 2 +- .../upgrade_prometheus_operator_crds.sh | 33 +++++++++++++++++++ 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100755 scripts/kube-prometheus-stack/upgrade_prometheus_operator_crds.sh diff --git a/README.md b/README.md index 21ec12f3..4d956437 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,19 @@ helm upgrade -f pulsar.yaml \ For more detailed information, see our [Upgrading](http://pulsar.apache.org/docs/helm-upgrade/) guide. +## Upgrading from Helm Chart version 3.0.0-3.2.x to 3.3.0 version and above + +The kube-prometheus-stack version has been upgraded to 56.x.x in Pulsar Helm Chart version 3.3.0 . +Before running "helm upgrade", you should first upgrade the Prometheus Operator CRDs as [instructed +in kube-prometheus-stack upgrade notes](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack#from-55x-to-56x). + +There's a script to run the required commands: +```shell +./scripts/kube-prometheus-stack/upgrade_prometeheus_operator_crds.sh +``` + +After, this you can proceed with `helm upgrade`. + ## Upgrading to Apache Pulsar 2.10.0 and above (or Helm Chart version 3.0.0 and above) The 2.10.0+ Apache Pulsar docker image is a non-root container, by default. That complicates an upgrade to 2.10.0 diff --git a/charts/pulsar/Chart.yaml b/charts/pulsar/Chart.yaml index 07af8fd7..8961c71c 100644 --- a/charts/pulsar/Chart.yaml +++ b/charts/pulsar/Chart.yaml @@ -33,6 +33,6 @@ maintainers: email: dev@pulsar.apache.org dependencies: - name: kube-prometheus-stack - version: 41.x.x + version: 56.x.x repository: https://prometheus-community.github.io/helm-charts condition: kube-prometheus-stack.enabled diff --git a/scripts/kube-prometheus-stack/upgrade_prometheus_operator_crds.sh b/scripts/kube-prometheus-stack/upgrade_prometheus_operator_crds.sh new file mode 100755 index 00000000..f37ac392 --- /dev/null +++ b/scripts/kube-prometheus-stack/upgrade_prometheus_operator_crds.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# + +# This script is used to upgrade the Prometheus Operator CRDs before running "helm upgrade" +# source: https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack#from-55x-to-56x +# "Run these commands to update the CRDs before applying the upgrade." +kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.71.0/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagerconfigs.yaml +kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.71.0/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagers.yaml +kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.71.0/example/prometheus-operator-crd/monitoring.coreos.com_podmonitors.yaml +kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.71.0/example/prometheus-operator-crd/monitoring.coreos.com_probes.yaml +kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.71.0/example/prometheus-operator-crd/monitoring.coreos.com_prometheusagents.yaml +kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.71.0/example/prometheus-operator-crd/monitoring.coreos.com_prometheuses.yaml +kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.71.0/example/prometheus-operator-crd/monitoring.coreos.com_prometheusrules.yaml +kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.71.0/example/prometheus-operator-crd/monitoring.coreos.com_scrapeconfigs.yaml +kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.71.0/example/prometheus-operator-crd/monitoring.coreos.com_servicemonitors.yaml +kubectl apply --server-side -f https://raw.githubusercontent.com/prometheus-operator/prometheus-operator/v0.71.0/example/prometheus-operator-crd/monitoring.coreos.com_thanosrulers.yaml \ No newline at end of file