Skip to content

Commit

Permalink
Add CI test case for kube-prometheus-stack upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
lhotari committed Jan 25, 2024
1 parent 641ab27 commit d6660c1
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .ci/chart_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ if [[ "$UPGRADE_FROM_VERSION" != "" ]]; then
# produce messages with old version of pulsar and consume with new version
ci::test_pulsar_producer_consumer "produce"
test_action="consume"

if [[ "$(ci::helm_values_for_deployment | yq .kube-prometheus-stack.enabled)" == "true" ]]; then
echo "Upgrade Prometheus Operator CRDs before upgrading the deployment"
${PULSAR_HOME}/scripts/kube-prometheus-stack/upgrade_prometheus_operator_crds.sh
fi
fi

PULSAR_CHART_VERSION="local"
Expand Down
30 changes: 30 additions & 0 deletions .ci/clusters/values-prometheus-grafana.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#
# 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.
#

kube-prometheus-stack:
enabled: true
prometheus:
enabled: true
grafana:
enabled: true
adminPassword: pulsar-ci-admin
alertmanager:
enabled: false
prometheus-node-exporter:
enabled: true
11 changes: 10 additions & 1 deletion .github/workflows/pulsar-helm-chart-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,15 @@ jobs:
values_file: .ci/clusters/values-psp.yaml
shortname: psp
type: upgrade
- k8sVersion:
version: "1.21.14"
kind_image_tag: v1.21.14@sha256:8a4e9bb3f415d2bb81629ce33ef9c76ba514c14d707f9797a01e3216376ba093
testScenario:
name: "Upgrade kube-prometheus-stack"
values_file: .ci/clusters/values-prometheus-grafana.yaml
shortname: prometheus-grafana
type: upgrade
upgradeFromVersion: 3.2.0
- k8sVersion:
version: "1.21.14"
kind_image_tag: v1.21.14@sha256:8a4e9bb3f415d2bb81629ce33ef9c76ba514c14d707f9797a01e3216376ba093
Expand Down Expand Up @@ -270,7 +279,7 @@ jobs:
;;
esac
if [[ "${{ matrix.testScenario.type || 'install' }}" == "upgrade" ]]; then
export UPGRADE_FROM_VERSION=latest
export UPGRADE_FROM_VERSION="${{ matrix.testScenario.upgradeFromVersion || 'latest' }}"
fi
.ci/chart_test.sh ${{ matrix.testScenario.values_file }}
Expand Down

0 comments on commit d6660c1

Please sign in to comment.