From 6ae2edbc816846af61695971dfb8dfa7e945510b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20S=C3=BC=C3=9F?= Date: Fri, 5 Apr 2024 11:12:52 +0200 Subject: [PATCH 1/2] docs: add helm upgrade instructions --- deploy/helm/grafana-operator/README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/deploy/helm/grafana-operator/README.md b/deploy/helm/grafana-operator/README.md index b1a47f73d..78b2e2142 100644 --- a/deploy/helm/grafana-operator/README.md +++ b/deploy/helm/grafana-operator/README.md @@ -14,11 +14,23 @@ linkTitle: "Helm installation" This is a OCI helm chart, helm started support OCI in version 3.8.0. ```shell -helm upgrade -i grafana-operator oci://ghcr.io/grafana/helm-charts/grafana-operator --version v5.7.0 +helm upgrade -i grafana-operator oci://ghcr.io/grafana/helm-charts/grafana-operator --version v5.8.1 ``` Sadly helm OCI charts currently don't support searching for available versions of a helm [oci registry](https://github.com/helm/helm/issues/11000). +## Upgrading + +Helm does not provide functionality to update custom resource definitions. This can result in the operator misbehaving when a release contains updates to the custom resource definitions. +To avoid issues due to outdated or missing definitions, run the following command before updating an existing installation: + +```shell +kubectl apply --server-side --force-conflicts -f https://github.com/grafana/grafana-operator/releases/download/v5.8.1/crds.yaml +``` + +The `--server-side` and `--force-conflict` flags are required to avoid running into issues with the `kubectl.kubernetes.io/last-applied-configuration` annotation. +By using server side apply, this annotation is not considered. `--force-conflict` allows kubectl to modify fields previously managed by helm. + ## Development For general and helm specific development instructions please read the [CONTRIBUTING.md](../../../CONTRIBUTING.md) From b99accf11d29e94a5317ee309e29289c19fca666 Mon Sep 17 00:00:00 2001 From: Edvin Norling Date: Tue, 9 Apr 2024 15:24:26 +0200 Subject: [PATCH 2/2] use the template instead --- deploy/helm/grafana-operator/Chart.yaml | 2 +- deploy/helm/grafana-operator/README.md | 2 +- deploy/helm/grafana-operator/README.md.gotmpl | 12 ++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/deploy/helm/grafana-operator/Chart.yaml b/deploy/helm/grafana-operator/Chart.yaml index 878f8ebcf..2ca18cbce 100644 --- a/deploy/helm/grafana-operator/Chart.yaml +++ b/deploy/helm/grafana-operator/Chart.yaml @@ -21,4 +21,4 @@ version: 0.1.3 # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "v5.7.0" +appVersion: "v5.8.1" diff --git a/deploy/helm/grafana-operator/README.md b/deploy/helm/grafana-operator/README.md index 78b2e2142..1a5c15149 100644 --- a/deploy/helm/grafana-operator/README.md +++ b/deploy/helm/grafana-operator/README.md @@ -7,7 +7,7 @@ linkTitle: "Helm installation" [grafana-operator](https://github.com/grafana/grafana-operator) for Kubernetes to manage Grafana instances and grafana resources. -![Version: 0.1.3](https://img.shields.io/badge/Version-0.1.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v5.7.0](https://img.shields.io/badge/AppVersion-v5.7.0-informational?style=flat-square) +![Version: 0.1.3](https://img.shields.io/badge/Version-0.1.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v5.8.1](https://img.shields.io/badge/AppVersion-v5.8.1-informational?style=flat-square) ## Installation diff --git a/deploy/helm/grafana-operator/README.md.gotmpl b/deploy/helm/grafana-operator/README.md.gotmpl index f6193defd..b74c04aed 100644 --- a/deploy/helm/grafana-operator/README.md.gotmpl +++ b/deploy/helm/grafana-operator/README.md.gotmpl @@ -19,6 +19,18 @@ helm upgrade -i grafana-operator oci://ghcr.io/grafana/helm-charts/grafana-opera Sadly helm OCI charts currently don't support searching for available versions of a helm [oci registry](https://github.com/helm/helm/issues/11000). +## Upgrading + +Helm does not provide functionality to update custom resource definitions. This can result in the operator misbehaving when a release contains updates to the custom resource definitions. +To avoid issues due to outdated or missing definitions, run the following command before updating an existing installation: + +```shell +kubectl apply --server-side --force-conflicts -f https://github.com/grafana/grafana-operator/releases/download/{{ template "chart.appVersion" . }}/crds.yaml +``` + +The `--server-side` and `--force-conflict` flags are required to avoid running into issues with the `kubectl.kubernetes.io/last-applied-configuration` annotation. +By using server side apply, this annotation is not considered. `--force-conflict` allows kubectl to modify fields previously managed by helm. + ## Development For general and helm specific development instructions please read the [CONTRIBUTING.md](../../../CONTRIBUTING.md)