From b6d23ba80df8496f22b2e85524dd4450178bcc7a Mon Sep 17 00:00:00 2001 From: Andrei Kvapil Date: Tue, 2 Jan 2024 21:49:10 +0100 Subject: [PATCH] upd: grafana-operator --- .../charts/grafana-operator/Chart.yaml | 4 +- .../charts/grafana-operator/README.md | 8 +- .../charts/grafana-operator/README.md.gotmpl | 4 +- .../grafana.integreatly.org_grafanas.yaml | 144 ++++++++++++++++-- .../charts/grafana-operator/templates/cm.yaml | 1 + .../templates/deployment.yaml | 1 + .../grafana-operator/templates/rbac.yaml | 24 +-- .../grafana-operator/templates/service.yaml | 1 + .../templates/serviceaccount.yaml | 1 + .../charts/grafana-operator/values.yaml | 5 +- 10 files changed, 163 insertions(+), 30 deletions(-) diff --git a/packages/system/grafana-operator/charts/grafana-operator/Chart.yaml b/packages/system/grafana-operator/charts/grafana-operator/Chart.yaml index 67518d65..2bbf10b1 100644 --- a/packages/system/grafana-operator/charts/grafana-operator/Chart.yaml +++ b/packages/system/grafana-operator/charts/grafana-operator/Chart.yaml @@ -15,10 +15,10 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.1 +version: 0.1.2 # This is the version number of the application being deployed. This version number should be # 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.4.1" +appVersion: "v5.6.0" diff --git a/packages/system/grafana-operator/charts/grafana-operator/README.md b/packages/system/grafana-operator/charts/grafana-operator/README.md index 51470461..697f1b1a 100644 --- a/packages/system/grafana-operator/charts/grafana-operator/README.md +++ b/packages/system/grafana-operator/charts/grafana-operator/README.md @@ -5,16 +5,16 @@ linkTitle: "Helm installation" # grafana-operator -[grafana-operator](https://github.com/grafana-operator/grafana-operator) for Kubernetes to manage Grafana instances and grafana resources. +[grafana-operator](https://github.com/grafana/grafana-operator) for Kubernetes to manage Grafana instances and grafana resources. -![Version: 0.1.1](https://img.shields.io/badge/Version-0.1.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v5.4.1](https://img.shields.io/badge/AppVersion-v5.4.1-informational?style=flat-square) +![Version: 0.1.2](https://img.shields.io/badge/Version-0.1.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v5.6.0](https://img.shields.io/badge/AppVersion-v5.6.0-informational?style=flat-square) ## 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-operator/helm-charts/grafana-operator --version v5.4.1 +helm upgrade -i grafana-operator oci://ghcr.io/grafana/helm-charts/grafana-operator --version v5.6.0 ``` Sadly helm OCI charts currently don't support searching for available versions of a helm [oci registry](https://github.com/helm/helm/issues/11000). @@ -40,7 +40,7 @@ It's easier to just manage this configuration outside of the operator. | env | list | `[]` | Additional environment variables | | fullnameOverride | string | `""` | | | image.pullPolicy | string | `"IfNotPresent"` | The image pull policy to use in grafana operator container | -| image.repository | string | `"ghcr.io/grafana-operator/grafana-operator"` | grafana operator image repository | +| image.repository | string | `"ghcr.io/grafana/grafana-operator"` | grafana operator image repository | | image.tag | string | `""` | Overrides the image tag whose default is the chart appVersion. | | imagePullSecrets | list | `[]` | image pull secrets | | leaderElect | bool | `false` | If you want to run multiple replicas of the grafana-operator, this is not recommended. | diff --git a/packages/system/grafana-operator/charts/grafana-operator/README.md.gotmpl b/packages/system/grafana-operator/charts/grafana-operator/README.md.gotmpl index 5ef4494b..f6193def 100644 --- a/packages/system/grafana-operator/charts/grafana-operator/README.md.gotmpl +++ b/packages/system/grafana-operator/charts/grafana-operator/README.md.gotmpl @@ -5,7 +5,7 @@ linkTitle: "Helm installation" {{ template "chart.header" . }} -[grafana-operator](https://github.com/grafana-operator/grafana-operator) for Kubernetes to manage Grafana instances and grafana resources. +[grafana-operator](https://github.com/grafana/grafana-operator) for Kubernetes to manage Grafana instances and grafana resources. {{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }} @@ -14,7 +14,7 @@ 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-operator/helm-charts/grafana-operator --version {{ template "chart.appVersion" . }} +helm upgrade -i grafana-operator oci://ghcr.io/grafana/helm-charts/grafana-operator --version {{ template "chart.appVersion" . }} ``` Sadly helm OCI charts currently don't support searching for available versions of a helm [oci registry](https://github.com/helm/helm/issues/11000). diff --git a/packages/system/grafana-operator/charts/grafana-operator/crds/grafana.integreatly.org_grafanas.yaml b/packages/system/grafana-operator/charts/grafana-operator/crds/grafana.integreatly.org_grafanas.yaml index 7f7dac4d..23175423 100644 --- a/packages/system/grafana-operator/charts/grafana-operator/crds/grafana.integreatly.org_grafanas.yaml +++ b/packages/system/grafana-operator/charts/grafana-operator/crds/grafana.integreatly.org_grafanas.yaml @@ -268,6 +268,16 @@ spec: type: object type: object x-kubernetes-map-type: atomic + matchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + mismatchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic namespaceSelector: properties: matchExpressions: @@ -336,6 +346,16 @@ spec: type: object type: object x-kubernetes-map-type: atomic + matchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + mismatchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic namespaceSelector: properties: matchExpressions: @@ -402,6 +422,16 @@ spec: type: object type: object x-kubernetes-map-type: atomic + matchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + mismatchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic namespaceSelector: properties: matchExpressions: @@ -470,6 +500,16 @@ spec: type: object type: object x-kubernetes-map-type: atomic + matchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic + mismatchLabelKeys: + items: + type: string + type: array + x-kubernetes-list-type: atomic namespaceSelector: properties: matchExpressions: @@ -649,6 +689,14 @@ spec: required: - port type: object + sleep: + properties: + seconds: + format: int64 + type: integer + required: + - seconds + type: object tcpSocket: properties: host: @@ -699,6 +747,14 @@ spec: required: - port type: object + sleep: + properties: + seconds: + format: int64 + type: integer + required: + - seconds + type: object tcpSocket: properties: host: @@ -1293,6 +1349,14 @@ spec: required: - port type: object + sleep: + properties: + seconds: + format: int64 + type: integer + required: + - seconds + type: object tcpSocket: properties: host: @@ -1343,6 +1407,14 @@ spec: required: - port type: object + sleep: + properties: + seconds: + format: int64 + type: integer + required: + - seconds + type: object tcpSocket: properties: host: @@ -1944,6 +2016,14 @@ spec: required: - port type: object + sleep: + properties: + seconds: + format: int64 + type: integer + required: + - seconds + type: object tcpSocket: properties: host: @@ -1994,6 +2074,14 @@ spec: required: - port type: object + sleep: + properties: + seconds: + format: int64 + type: integer + required: + - seconds + type: object tcpSocket: properties: host: @@ -2846,18 +2934,6 @@ spec: type: object resources: properties: - claims: - items: - properties: - name: - type: string - required: - - name - type: object - type: array - x-kubernetes-list-map-keys: - - name - x-kubernetes-list-type: map limits: additionalProperties: anyOf: @@ -2901,6 +2977,8 @@ spec: x-kubernetes-map-type: atomic storageClassName: type: string + volumeAttributesClassName: + type: string volumeMode: type: string volumeName: @@ -3089,6 +3167,43 @@ spec: sources: items: properties: + clusterTrustBundle: + properties: + labelSelector: + properties: + matchExpressions: + items: + properties: + key: + type: string + operator: + type: string + values: + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + type: object + type: object + x-kubernetes-map-type: atomic + name: + type: string + optional: + type: boolean + path: + type: string + signerName: + type: string + required: + - path + type: object configMap: properties: items: @@ -3629,6 +3744,11 @@ spec: type: string type: object type: object + preferences: + properties: + homeDashboardUid: + type: string + type: object route: properties: metadata: diff --git a/packages/system/grafana-operator/charts/grafana-operator/templates/cm.yaml b/packages/system/grafana-operator/charts/grafana-operator/templates/cm.yaml index c3f78471..cc4866e2 100644 --- a/packages/system/grafana-operator/charts/grafana-operator/templates/cm.yaml +++ b/packages/system/grafana-operator/charts/grafana-operator/templates/cm.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ include "grafana-operator.fullname" . }} + namespace: {{ .Release.Namespace | quote }} labels: {{- with .Values.additionalLabels }} {{- toYaml . | nindent 4 }} diff --git a/packages/system/grafana-operator/charts/grafana-operator/templates/deployment.yaml b/packages/system/grafana-operator/charts/grafana-operator/templates/deployment.yaml index db3f2ff0..b22be24e 100644 --- a/packages/system/grafana-operator/charts/grafana-operator/templates/deployment.yaml +++ b/packages/system/grafana-operator/charts/grafana-operator/templates/deployment.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "grafana-operator.fullname" . }} + namespace: {{ .Release.Namespace | quote }} labels: {{- include "grafana-operator.labels" . | nindent 4 }} {{- with .Values.additionalLabels }} diff --git a/packages/system/grafana-operator/charts/grafana-operator/templates/rbac.yaml b/packages/system/grafana-operator/charts/grafana-operator/templates/rbac.yaml index f2972b91..983e45e6 100644 --- a/packages/system/grafana-operator/charts/grafana-operator/templates/rbac.yaml +++ b/packages/system/grafana-operator/charts/grafana-operator/templates/rbac.yaml @@ -9,12 +9,15 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: {{ if not $namespaceScoped }}Cluster{{ end }}Role metadata: - namespace: {{ . }} - name: grafana-operator-permissions - {{- with (merge $.Values.additionalLabels (include "grafana-operator.labels" $ | fromYaml)) }} - labels: - {{- toYaml . | nindent 4 }} + {{- if $namespaceScoped }} + namespace: {{ $operatorNamespace }} {{- end }} + name: grafana-operator-permissions + labels: + {{- include "grafana-operator.labels" $ | nindent 4 }} + {{- with $.Values.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} rules: - apiGroups: - "" @@ -230,11 +233,14 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: {{ if not $namespaceScoped }}Cluster{{ end }}RoleBinding metadata: name: grafana-operator-permissions - namespace: {{ . }} - {{- with (merge $.Values.additionalLabels (include "grafana-operator.labels" $ | fromYaml)) }} - labels: - {{- toYaml . | nindent 4 }} + {{- if $namespaceScoped }} + namespace: {{ $operatorNamespace }} {{- end }} + labels: + {{- include "grafana-operator.labels" $ | nindent 4 }} + {{- with $.Values.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} subjects: - kind: ServiceAccount name: {{ include "grafana-operator.serviceAccountName" $ }} diff --git a/packages/system/grafana-operator/charts/grafana-operator/templates/service.yaml b/packages/system/grafana-operator/charts/grafana-operator/templates/service.yaml index 8aea0654..f765c94b 100644 --- a/packages/system/grafana-operator/charts/grafana-operator/templates/service.yaml +++ b/packages/system/grafana-operator/charts/grafana-operator/templates/service.yaml @@ -2,6 +2,7 @@ apiVersion: v1 kind: Service metadata: name: {{ include "grafana-operator.fullname" . }}-metrics-service + namespace: {{ .Release.Namespace | quote }} labels: {{- include "grafana-operator.labels" . | nindent 4 }} {{- with .Values.additionalLabels }} diff --git a/packages/system/grafana-operator/charts/grafana-operator/templates/serviceaccount.yaml b/packages/system/grafana-operator/charts/grafana-operator/templates/serviceaccount.yaml index 1c3ca841..1b31f313 100644 --- a/packages/system/grafana-operator/charts/grafana-operator/templates/serviceaccount.yaml +++ b/packages/system/grafana-operator/charts/grafana-operator/templates/serviceaccount.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "grafana-operator.serviceAccountName" . }} + namespace: {{ .Release.Namespace | quote }} labels: {{- include "grafana-operator.labels" . | nindent 4 }} {{- with .Values.additionalLabels }} diff --git a/packages/system/grafana-operator/charts/grafana-operator/values.yaml b/packages/system/grafana-operator/charts/grafana-operator/values.yaml index ae3caa1f..c51ec700 100644 --- a/packages/system/grafana-operator/charts/grafana-operator/values.yaml +++ b/packages/system/grafana-operator/charts/grafana-operator/values.yaml @@ -12,12 +12,15 @@ watchNamespaces: "" # -- Additional environment variables env: [] + # -- grafana image, e.g. docker.io/grafana/grafana:9.1.6, overwrites the default grafana image defined in the operator + # - name: RELATED_IMAGE_GRAFANA + # value: "docker.io/grafana/grafana:9.1.6" # - name: MY_VAR # value: "myvalue" image: # -- grafana operator image repository - repository: ghcr.io/grafana-operator/grafana-operator + repository: ghcr.io/grafana/grafana-operator # -- The image pull policy to use in grafana operator container pullPolicy: IfNotPresent # -- Overrides the image tag whose default is the chart appVersion.