[bitnami/grafana] add label to Grafana (#2773)

* [bitnami/grafana] add label to Grafana

Label based Kubernetes network policies can not properly
distinguish Grafana and the recently added Image Renderer
due to common label.

Image Renderer already have a separate label, thus Grafana
also shall have a separate label to fulfill need for
consistency.

Signed-off-by: Alex Szakaly <alex.szakaly@gmail.com>

* [bitnami/grafana] Bump major version required due to selector label changes

Add upgrading section to notify end-users about compatibility breakage

Signed-off-by: Alex Szakaly <alex.szakaly@gmail.com>
This commit is contained in:
Alex SZAKALY
2020-07-02 18:03:05 +02:00
committed by GitHub
parent dc3bb78cd7
commit 7f51ea83d6
11 changed files with 26 additions and 1 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: grafana
version: 2.1.3
version: 3.0.0
appVersion: 7.0.5
description: Grafana is an open source, feature rich metrics dashboard and graph editor for Graphite, Elasticsearch, OpenTSDB, Prometheus and InfluxDB.
keywords:
+12
View File
@@ -373,3 +373,15 @@ The [Bitnami Grafana](https://github.com/bitnami/bitnami-docker-grafana) image s
Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube.
See the [Parameters](#parameters) section to configure the PVC or to disable persistence.
## Upgrading
### To 3.0.0
Deployment label selector is immutable after it gets created, so you cannot "upgrade".
In https://github.com/bitnami/charts/pull/2773 the deployment label selectors of the resources were updated to add the component name. Resulting in compatibility breakage.
In order to "upgrade" from a previous version, you will need to [uninstall](#uninstalling-the-chart) the existing chart manually.
This major version signifies this change.
+1
View File
@@ -3,6 +3,7 @@ kind: ConfigMap
metadata:
name: {{ include "grafana.fullname" . }}-envvars
labels: {{- include "grafana.labels" . | nindent 4 }}
app.kubernetes.io/component: grafana
data:
GF_SECURITY_ADMIN_USER: {{ .Values.admin.user | quote }}
{{- if .Values.imageRenderer.enabled }}
@@ -4,6 +4,7 @@ kind: ConfigMap
metadata:
name: {{ include "grafana.fullname" . }}-provider
labels: {{- include "grafana.labels" . | nindent 4 }}
app.kubernetes.io/component: grafana
data:
default-provider.yaml: |-
apiVersion: 1
@@ -3,16 +3,19 @@ kind: Deployment
metadata:
name: {{ include "grafana.fullname" . }}
labels: {{- include "grafana.labels" . | nindent 4 }}
app.kubernetes.io/component: grafana
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels: {{- include "grafana.matchLabels" . | nindent 6 }}
app.kubernetes.io/component: grafana
{{- if .Values.updateStrategy }}
strategy: {{ toYaml .Values.updateStrategy | nindent 4 }}
{{- end }}
template:
metadata:
labels: {{- include "grafana.labels" . | nindent 8 }}
app.kubernetes.io/component: grafana
annotations:
{{- if (include "grafana.createAdminSecret" .) }}
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
+1
View File
@@ -4,6 +4,7 @@ kind: Ingress
metadata:
name: {{ include "grafana.fullname" . }}
labels: {{- include "grafana.labels" . | nindent 4 }}
app.kubernetes.io/component: grafana
annotations:
{{- if .Values.ingress.certManager }}
kubernetes.io/tls-acme: "true"
+1
View File
@@ -4,6 +4,7 @@ apiVersion: v1
metadata:
name: {{ template "grafana.fullname" . }}
labels: {{- include "grafana.labels" . | nindent 4 }}
app.kubernetes.io/component: grafana
spec:
accessModes:
- {{ .Values.persistence.accessMode | quote }}
+1
View File
@@ -4,6 +4,7 @@ kind: Secret
metadata:
name: {{ template "grafana.fullname" . }}-admin
labels: {{- include "grafana.labels" . | nindent 4 }}
app.kubernetes.io/component: grafana
type: Opaque
data:
GF_SECURITY_ADMIN_PASSWORD: {{ ternary (randAlphaNum 10) .Values.admin.password (empty .Values.admin.password) | b64enc | quote }}
+2
View File
@@ -3,6 +3,7 @@ kind: Service
metadata:
name: {{ include "grafana.fullname" . }}
labels: {{- include "grafana.labels" . | nindent 4 }}
app.kubernetes.io/component: grafana
{{- if or (and .Values.metrics.enabled .Values.metrics.service.annotations) .Values.service.annotations }}
annotations:
{{- if and .Values.metrics.enabled .Values.metrics.service.annotations }}
@@ -31,3 +32,4 @@ spec:
nodePort: null
{{- end }}
selector: {{- include "grafana.matchLabels" . | nindent 4 }}
app.kubernetes.io/component: grafana
@@ -7,12 +7,14 @@ metadata:
namespace: {{ .Values.metrics.serviceMonitor.namespace }}
{{- end }}
labels: {{- include "grafana.labels" . | nindent 4 }}
app.kubernetes.io/component: grafana
{{- range $key, $value := .Values.metrics.serviceMonitor.selector }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
selector:
matchLabels: {{ include "grafana.matchLabels" . | nindent 6 }}
app.kubernetes.io/component: grafana
endpoints:
- port: http
path: "/metrics"
@@ -4,6 +4,7 @@ kind: Secret
metadata:
name: {{ template "grafana.fullname" . }}-smtp
labels: {{- include "grafana.labels" . | nindent 4 }}
app.kubernetes.io/component: grafana
type: Opaque
data:
GF_SMTP_USER: {{ .Values.smtp.user | b64enc | quote }}