From 1ccfc8be4f3ca5f26b991f7e1d2eaccd9bbefadf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Tue, 18 Feb 2020 22:24:25 +0100 Subject: [PATCH] update grafana & all other docker images - updated labels (#20808) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Bauer --- stable/grafana/Chart.yaml | 4 +- stable/grafana/README.md | 69 ++++++++++--------- stable/grafana/templates/_helpers.tpl | 20 ++++++ stable/grafana/templates/clusterrole.yaml | 5 +- .../grafana/templates/clusterrolebinding.yaml | 5 +- .../configmap-dashboard-provider.yaml | 5 +- stable/grafana/templates/configmap.yaml | 5 +- .../templates/dashboards-json-configmap.yaml | 5 +- stable/grafana/templates/deployment.yaml | 11 +-- .../grafana/templates/headless-service.yaml | 5 +- stable/grafana/templates/ingress.yaml | 5 +- .../templates/poddisruptionbudget.yaml | 8 +-- .../grafana/templates/podsecuritypolicy.yaml | 5 +- stable/grafana/templates/pvc.yaml | 5 +- stable/grafana/templates/role.yaml | 5 +- stable/grafana/templates/rolebinding.yaml | 5 +- stable/grafana/templates/secret-env.yaml | 5 +- stable/grafana/templates/secret.yaml | 5 +- stable/grafana/templates/service.yaml | 8 +-- stable/grafana/templates/serviceaccount.yaml | 5 +- stable/grafana/templates/statefulset.yaml | 11 +-- .../templates/tests/test-configmap.yaml | 7 +- .../tests/test-podsecuritypolicy.yaml | 5 +- stable/grafana/templates/tests/test-role.yaml | 5 +- .../templates/tests/test-rolebinding.yaml | 5 +- .../templates/tests/test-serviceaccount.yaml | 5 +- stable/grafana/templates/tests/test.yaml | 24 +------ stable/grafana/values.yaml | 14 ++-- 28 files changed, 99 insertions(+), 167 deletions(-) diff --git a/stable/grafana/Chart.yaml b/stable/grafana/Chart.yaml index 247c13cfc8..7c31b8889c 100644 --- a/stable/grafana/Chart.yaml +++ b/stable/grafana/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: grafana -version: 4.6.3 -appVersion: 6.6.0 +version: 5.0.0 +appVersion: 6.6.1 kubeVersion: "^1.8.0-0" description: The leading tool for querying and visualizing time series and metrics. home: https://grafana.net diff --git a/stable/grafana/README.md b/stable/grafana/README.md index 12d8c4811c..059111ccef 100644 --- a/stable/grafana/README.md +++ b/stable/grafana/README.md @@ -35,20 +35,24 @@ incompatible breaking change needing manual actions. This version requires Helm >= 2.12.0. +### To 5.0.0 + +You have to add --force to your helm upgrade command as the labels of the chart have changed. + ## Configuration | Parameter | Description | Default | |-------------------------------------------|-----------------------------------------------|---------------------------------------------------------| | `replicas` | Number of nodes | `1` | -| `podDisruptionBudget.minAvailable` | Pod disruption minimum available | `nil` | -| `podDisruptionBudget.maxUnavailable` | Pod disruption maximum unavailable | `nil` | +| `podDisruptionBudget.minAvailable` | Pod disruption minimum available | `nil` | +| `podDisruptionBudget.maxUnavailable` | Pod disruption maximum unavailable | `nil` | | `deploymentStrategy` | Deployment strategy | `{ "type": "RollingUpdate" }` | | `livenessProbe` | Liveness Probe settings | `{ "httpGet": { "path": "/api/health", "port": 3000 } "initialDelaySeconds": 60, "timeoutSeconds": 30, "failureThreshold": 10 }` | | `readinessProbe` | Readiness Probe settings | `{ "httpGet": { "path": "/api/health", "port": 3000 } }`| | `securityContext` | Deployment securityContext | `{"runAsUser": 472, "fsGroup": 472}` | | `priorityClassName` | Name of Priority Class to assign pods | `nil` | | `image.repository` | Image repository | `grafana/grafana` | -| `image.tag` | Image tag (`Must be >= 5.0.0`) | `6.5.2` | +| `image.tag` | Image tag (`Must be >= 5.0.0`) | `6.6.1` | | `image.pullPolicy` | Image pull policy | `IfNotPresent` | | `image.pullSecrets` | Image pull secrets | `{}` | | `service.type` | Kubernetes service type | `ClusterIP` | @@ -73,11 +77,11 @@ This version requires Helm >= 2.12.0. | `nodeSelector` | Node labels for pod assignment | `{}` | | `tolerations` | Toleration labels for pod assignment | `[]` | | `affinity` | Affinity settings for pod assignment | `{}` | -| `extraInitContainers` | Init containers to add to the grafana pod | `{}` | -| `extraContainers` | Sidecar containers to add to the grafana pod | `{}` | +| `extraInitContainers` | Init containers to add to the grafana pod | `{}` | +| `extraContainers` | Sidecar containers to add to the grafana pod | `{}` | | `schedulerName` | Name of the k8s scheduler (other than default) | `nil` | | `persistence.enabled` | Use persistent volume to store data | `false` | -| `persistence.type` | Type of persistence (`pvc` or `statefulset`) | `pvc` | +| `persistence.type` | Type of persistence (`pvc` or `statefulset`) | `pvc` | | `persistence.size` | Size of persistent volume claim | `10Gi` | | `persistence.existingClaim` | Use an existing PVC to persist data | `nil` | | `persistence.storageClassName` | Type of persistent volume claim | `nil` | @@ -97,28 +101,28 @@ This version requires Helm >= 2.12.0. | `envRenderSecret` | Sensible environment variables passed to pods and stored as secret | `{}` | | `extraSecretMounts` | Additional grafana server secret mounts | `[]` | | `extraVolumeMounts` | Additional grafana server volume mounts | `[]` | -| `extraConfigmapMounts` | Additional grafana server configMap volume mounts | `[]` | -| `extraEmptyDirMounts` | Additional grafana server emptyDir volume mounts | `[]` | +| `extraConfigmapMounts` | Additional grafana server configMap volume mounts | `[]` | +| `extraEmptyDirMounts` | Additional grafana server emptyDir volume mounts | `[]` | | `plugins` | Plugins to be loaded along with Grafana | `[]` | -| `datasources` | Configure grafana datasources (passed through tpl) | `{}` | -| `notifiers` | Configure grafana notifiers | `{}` | +| `datasources` | Configure grafana datasources (passed through tpl) | `{}` | +| `notifiers` | Configure grafana notifiers | `{}` | | `dashboardProviders` | Configure grafana dashboard providers | `{}` | | `dashboards` | Dashboards to import | `{}` | | `dashboardsConfigMaps` | ConfigMaps reference that contains dashboards | `{}` | | `grafana.ini` | Grafana's primary configuration | `{}` | | `ldap.enabled` | Enable LDAP authentication | `false` | | `ldap.existingSecret` | The name of an existing secret containing the `ldap.toml` file, this must have the key `ldap-toml`. | `""` | -| `ldap.config ` | Grafana's LDAP configuration | `""` | +| `ldap.config` | Grafana's LDAP configuration | `""` | | `annotations` | Deployment annotations | `{}` | | `labels` | Deployment labels | `{}` | | `podAnnotations` | Pod annotations | `{}` | | `podLabels` | Pod labels | `{}` | | `podPortName` | Name of the grafana port on the pod | `grafana` | -| `sidecar.image` | Sidecar image | `kiwigrid/k8s-sidecar:0.1.75` | +| `sidecar.image` | Sidecar image | `kiwigrid/k8s-sidecar:0.1.99` | | `sidecar.imagePullPolicy` | Sidecar image pull policy | `IfNotPresent` | | `sidecar.resources` | Sidecar resources | `{}` | | `sidecar.dashboards.enabled` | Enables the cluster wide search for dashboards and adds/updates/deletes them in grafana | `false` | -| `sidecar.dashboards.SCProvider` | Enables creation of sidecar provider | `true` +| `sidecar.dashboards.SCProvider` | Enables creation of sidecar provider | `true` | | `sidecar.dashboards.provider.name` | Unique name of the grafana provider | `sidecarProvider` | | `sidecar.dashboards.provider.orgid` | Id of the organisation, to which the dashboards should be added | `1` | | `sidecar.dashboards.provider.folder` | Logical folder in which grafana groups dashboards | `""` | @@ -126,10 +130,10 @@ This version requires Helm >= 2.12.0. | `sidecar.dashboards.provider.allowUiUpdates` | Allow updating provisioned dashboards from the UI | `false` | | `sidecar.dashboards.provider.type` | Provider type | `file` | | `sidecar.dashboards.watchMethod` | Method to use to detect ConfigMap changes. With WATCH the sidecar will do a WATCH requests, with SLEEP it will list all ConfigMaps, then sleep for 60 seconds. | `WATCH` | -| `sidecar.skipTlsVerify` | Set to true to skip tls verification for kube api calls | `nil` | +| `sidecar.skipTlsVerify` | Set to true to skip tls verification for kube api calls | `nil` | | `sidecar.dashboards.label` | Label that config maps with dashboards should have to be added | `grafana_dashboard` | -| `sidecar.dashboards.folder` | Folder in the pod that should hold the collected dashboards (unless `sidecar.dashboards.defaultFolderName` is set). This path will be mounted. | `/tmp/dashboards` | -| `sidecar.dashboards.defaultFolderName` | The default folder name, it will create a subfolder under the `sidecar.dashboards.folder` and put dashboards in there instead | `nil` | +| `sidecar.dashboards.folder` | Folder in the pod that should hold the collected dashboards (unless `sidecar.dashboards.defaultFolderName` is set). This path will be mounted. | `/tmp/dashboards` | +| `sidecar.dashboards.defaultFolderName` | The default folder name, it will create a subfolder under the `sidecar.dashboards.folder` and put dashboards in there instead | `nil` | | `sidecar.dashboards.searchNamespace` | If specified, the sidecar will search for dashboard config-maps inside this namespace. Otherwise the namespace in which the sidecar is running will be used. It's also possible to specify ALL to search in all namespaces | `nil` | | `sidecar.datasources.enabled` | Enables the cluster wide search for datasources and adds/updates/deletes them in grafana |`false` | | `sidecar.datasources.label` | Label that config maps with datasources should have to be added | `grafana_datasource` | @@ -140,24 +144,26 @@ This version requires Helm >= 2.12.0. | `admin.existingSecret` | The name of an existing secret containing the admin credentials. | `""` | | `admin.userKey` | The key in the existing admin secret containing the username. | `"admin-user"` | | `admin.passwordKey` | The key in the existing admin secret containing the password. | `"admin-password"` | -| `serviceAccount.annotations` | ServiceAccount annotations | -| `serviceAccount.create` | Create service account | `true` | +| `serviceAccount.annotations` | ServiceAccount annotations | | +| `serviceAccount.create` | Create service account | `true` | | `serviceAccount.name` | Service account name to use, when empty will be set to created account if `serviceAccount.create` is set else to `default` | `` | | `serviceAccount.nameTest` | Service account name to use for test, when empty will be set to created account if `serviceAccount.create` is set else to `default` | `` | -| `rbac.create` | Create and use RBAC resources | `true` | +| `rbac.create` | Create and use RBAC resources | `true` | | `rbac.namespaced` | Creates Role and Rolebinding instead of the default ClusterRole and ClusteRoleBindings for the grafana instance | `false` | -| `rbac.pspEnabled` | Create PodSecurityPolicy (with `rbac.create`, grant roles permissions as well) | `true` | -| `rbac.pspUseAppArmor` | Enforce AppArmor in created PodSecurityPolicy (requires `rbac.pspEnabled`) | `true` | -| `rbac.extraRoleRules` | Additional rules to add to the Role | [] | -| `rbac.extraClusterRoleRules` | Additional rules to add to the ClusterRole | [] | -| `command` | Define command to be executed by grafana container at startup | `nil` | -| `testFramework.enabled` | Whether to create test-related resources | `true` | -| `testFramework.image` | `test-framework` image repository. | `dduportal/bats` | -| `testFramework.tag` | `test-framework` image tag. | `0.4.0` | -| `testFramework.securityContext` | `test-framework` securityContext | `{}` | -| `downloadDashboards.env` | Environment variables to be passed to the `download-dashboards` container | `{}` | -| `namespaceOverride` | Override the deployment namespace | `""` (`Release.Namespace`) | - +| `rbac.pspEnabled` | Create PodSecurityPolicy (with `rbac.create`, grant roles permissions as well) | `true` | +| `rbac.pspUseAppArmor` | Enforce AppArmor in created PodSecurityPolicy (requires `rbac.pspEnabled`) | `true` | +| `rbac.extraRoleRules` | Additional rules to add to the Role | [] | +| `rbac.extraClusterRoleRules` | Additional rules to add to the ClusterRole | [] | +| `command` | Define command to be executed by grafana container at startup | `nil` | +| `testFramework.enabled` | Whether to create test-related resources | `true` | +| `testFramework.image` | `test-framework` image repository. | `bats/bats` | +| `testFramework.tag` | `test-framework` image tag. | `v1.1.0` | +| `testFramework.securityContext` | `test-framework` securityContext | `{}` | +| `downloadDashboards.env` | Environment variables to be passed to the `download-dashboards` container | `{}` | +| `downloadDashboardsImage.repository` | Curl docker image repo | `curlimages/curl` | +| `downloadDashboardsImage.tag` | Curl docker image tag | `7.68.0` | +| `downloadDashboardsImage.pullPolicy` | Curl docker image pull policy | `IfNotPresent` | +| `namespaceOverride` | Override the deployment namespace | `""` (`Release.Namespace`) | ### Example of extraVolumeMounts @@ -312,3 +318,4 @@ stringData: editable: false ``` + diff --git a/stable/grafana/templates/_helpers.tpl b/stable/grafana/templates/_helpers.tpl index 8a90064561..6b08bd1af4 100644 --- a/stable/grafana/templates/_helpers.tpl +++ b/stable/grafana/templates/_helpers.tpl @@ -60,3 +60,23 @@ Allow the release namespace to be overridden for multi-namespace deployments in {{- .Release.Namespace -}} {{- end -}} {{- end -}} + +{{/* +Common labels +*/}} +{{- define "grafana.labels" -}} +helm.sh/chart: {{ include "grafana.chart" . }} +{{ include "grafana.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end -}} + +{{/* +Selector labels +*/}} +{{- define "grafana.selectorLabels" -}} +app.kubernetes.io/name: {{ include "grafana.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end -}} diff --git a/stable/grafana/templates/clusterrole.yaml b/stable/grafana/templates/clusterrole.yaml index d14128001b..b3ef6ab3bf 100644 --- a/stable/grafana/templates/clusterrole.yaml +++ b/stable/grafana/templates/clusterrole.yaml @@ -3,10 +3,7 @@ kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: labels: - app: {{ template "grafana.name" . }} - chart: {{ template "grafana.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + {{- include "grafana.labels" . | nindent 4 }} {{- with .Values.annotations }} annotations: {{ toYaml . | indent 4 }} diff --git a/stable/grafana/templates/clusterrolebinding.yaml b/stable/grafana/templates/clusterrolebinding.yaml index 61e8110ca3..8ee08b2aa9 100644 --- a/stable/grafana/templates/clusterrolebinding.yaml +++ b/stable/grafana/templates/clusterrolebinding.yaml @@ -4,10 +4,7 @@ apiVersion: rbac.authorization.k8s.io/v1 metadata: name: {{ template "grafana.fullname" . }}-clusterrolebinding labels: - app: {{ template "grafana.name" . }} - chart: {{ template "grafana.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + {{- include "grafana.labels" . | nindent 4 }} {{- with .Values.annotations }} annotations: {{ toYaml . | indent 4 }} diff --git a/stable/grafana/templates/configmap-dashboard-provider.yaml b/stable/grafana/templates/configmap-dashboard-provider.yaml index 356a8bce38..af5d464b68 100644 --- a/stable/grafana/templates/configmap-dashboard-provider.yaml +++ b/stable/grafana/templates/configmap-dashboard-provider.yaml @@ -3,10 +3,7 @@ apiVersion: v1 kind: ConfigMap metadata: labels: - app: {{ template "grafana.name" . }} - chart: {{ template "grafana.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + {{- include "grafana.labels" . | nindent 4 }} {{- with .Values.annotations }} annotations: {{ toYaml . | indent 4 }} diff --git a/stable/grafana/templates/configmap.yaml b/stable/grafana/templates/configmap.yaml index e5dd9179b0..00c6957274 100644 --- a/stable/grafana/templates/configmap.yaml +++ b/stable/grafana/templates/configmap.yaml @@ -4,10 +4,7 @@ metadata: name: {{ template "grafana.fullname" . }} namespace: {{ template "grafana.namespace" . }} labels: - app: {{ template "grafana.name" . }} - chart: {{ template "grafana.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + {{- include "grafana.labels" . | nindent 4 }} data: {{- if .Values.plugins }} plugins: {{ join "," .Values.plugins }} diff --git a/stable/grafana/templates/dashboards-json-configmap.yaml b/stable/grafana/templates/dashboards-json-configmap.yaml index afc59bfe42..59e0be6415 100644 --- a/stable/grafana/templates/dashboards-json-configmap.yaml +++ b/stable/grafana/templates/dashboards-json-configmap.yaml @@ -7,10 +7,7 @@ metadata: name: {{ template "grafana.fullname" $ }}-dashboards-{{ $provider }} namespace: {{ template "grafana.namespace" $ }} labels: - app: {{ template "grafana.name" $ }} - chart: {{ template "grafana.chart" $ }} - release: {{ $.Release.Name }} - heritage: {{ $.Release.Service }} + {{- include "grafana.labels" $ | nindent 4 }} dashboard-provider: {{ $provider }} {{- if $dashboards }} data: diff --git a/stable/grafana/templates/deployment.yaml b/stable/grafana/templates/deployment.yaml index fcd08f4ac9..27a4b76d47 100644 --- a/stable/grafana/templates/deployment.yaml +++ b/stable/grafana/templates/deployment.yaml @@ -5,10 +5,7 @@ metadata: name: {{ template "grafana.fullname" . }} namespace: {{ template "grafana.namespace" . }} labels: - app: {{ template "grafana.name" . }} - chart: {{ template "grafana.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + {{- include "grafana.labels" . | nindent 4 }} {{- if .Values.labels }} {{ toYaml .Values.labels | indent 4 }} {{- end }} @@ -20,8 +17,7 @@ spec: replicas: {{ .Values.replicas }} selector: matchLabels: - app: {{ template "grafana.name" . }} - release: {{ .Release.Name }} + {{- include "grafana.selectorLabels" . | nindent 6 }} {{- with .Values.deploymentStrategy }} strategy: {{ toYaml . | trim | indent 4 }} @@ -29,8 +25,7 @@ spec: template: metadata: labels: - app: {{ template "grafana.name" . }} - release: {{ .Release.Name }} + {{- include "grafana.selectorLabels" . | nindent 8 }} {{- with .Values.podLabels }} {{ toYaml . | indent 8 }} {{- end }} diff --git a/stable/grafana/templates/headless-service.yaml b/stable/grafana/templates/headless-service.yaml index 7667b55468..9812d6f646 100644 --- a/stable/grafana/templates/headless-service.yaml +++ b/stable/grafana/templates/headless-service.yaml @@ -5,10 +5,7 @@ metadata: name: {{ template "grafana.fullname" . }}-headless namespace: {{ template "grafana.namespace" . }} labels: - app: {{ template "grafana.name" . }} - chart: {{ template "grafana.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + {{- include "grafana.labels" . | nindent 4 }} {{- with .Values.annotations }} annotations: {{ toYaml . | indent 4 }} diff --git a/stable/grafana/templates/ingress.yaml b/stable/grafana/templates/ingress.yaml index 5abfcbfe27..fe1695a6d4 100644 --- a/stable/grafana/templates/ingress.yaml +++ b/stable/grafana/templates/ingress.yaml @@ -9,10 +9,7 @@ metadata: name: {{ $fullName }} namespace: {{ template "grafana.namespace" . }} labels: - app: {{ template "grafana.name" . }} - chart: {{ template "grafana.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + {{- include "grafana.labels" . | nindent 4 }} {{- if .Values.ingress.labels }} {{ toYaml .Values.ingress.labels | indent 4 }} {{- end }} diff --git a/stable/grafana/templates/poddisruptionbudget.yaml b/stable/grafana/templates/poddisruptionbudget.yaml index 05f657d7ef..d6f230a8f2 100644 --- a/stable/grafana/templates/poddisruptionbudget.yaml +++ b/stable/grafana/templates/poddisruptionbudget.yaml @@ -5,10 +5,7 @@ metadata: name: {{ template "grafana.name" . }} namespace: {{ template "grafana.namespace" . }} labels: - app: {{ template "grafana.name" . }} - chart: {{ template "grafana.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + {{- include "grafana.labels" . | nindent 4 }} {{- if .Values.labels }} {{ toYaml .Values.labels | indent 4 }} {{- end }} @@ -21,6 +18,5 @@ spec: {{- end }} selector: matchLabels: - app: {{ template "grafana.name" . }} - release: {{ .Release.Name }} + {{- include "grafana.selectorLabels" . | nindent 6 }} {{- end }} diff --git a/stable/grafana/templates/podsecuritypolicy.yaml b/stable/grafana/templates/podsecuritypolicy.yaml index 7c99137fee..c5e6ba05ea 100644 --- a/stable/grafana/templates/podsecuritypolicy.yaml +++ b/stable/grafana/templates/podsecuritypolicy.yaml @@ -5,10 +5,7 @@ metadata: name: {{ template "grafana.fullname" . }} namespace: {{ template "grafana.namespace" . }} labels: - app: {{ template "grafana.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} + {{- include "grafana.labels" . | nindent 4 }} annotations: seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default' seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default' diff --git a/stable/grafana/templates/pvc.yaml b/stable/grafana/templates/pvc.yaml index f50b2f0990..90d5477d6c 100644 --- a/stable/grafana/templates/pvc.yaml +++ b/stable/grafana/templates/pvc.yaml @@ -5,10 +5,7 @@ metadata: name: {{ template "grafana.fullname" . }} namespace: {{ template "grafana.namespace" . }} labels: - app: {{ template "grafana.name" . }} - chart: {{ template "grafana.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + {{- include "grafana.labels" . | nindent 4 }} {{- with .Values.persistence.annotations }} annotations: {{ toYaml . | indent 4 }} diff --git a/stable/grafana/templates/role.yaml b/stable/grafana/templates/role.yaml index 65f551f60b..c95c1d0424 100644 --- a/stable/grafana/templates/role.yaml +++ b/stable/grafana/templates/role.yaml @@ -5,10 +5,7 @@ metadata: name: {{ template "grafana.fullname" . }} namespace: {{ template "grafana.namespace" . }} labels: - app: {{ template "grafana.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} + {{- include "grafana.labels" . | nindent 4 }} {{- with .Values.annotations }} annotations: {{ toYaml . | indent 4 }} diff --git a/stable/grafana/templates/rolebinding.yaml b/stable/grafana/templates/rolebinding.yaml index a47795fcb2..c42229bf92 100644 --- a/stable/grafana/templates/rolebinding.yaml +++ b/stable/grafana/templates/rolebinding.yaml @@ -5,10 +5,7 @@ metadata: name: {{ template "grafana.fullname" . }} namespace: {{ template "grafana.namespace" . }} labels: - app: {{ template "grafana.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} + {{- include "grafana.labels" . | nindent 4 }} {{- with .Values.annotations }} annotations: {{ toYaml . | indent 4 }} diff --git a/stable/grafana/templates/secret-env.yaml b/stable/grafana/templates/secret-env.yaml index 4c47fdac01..5c09313e66 100644 --- a/stable/grafana/templates/secret-env.yaml +++ b/stable/grafana/templates/secret-env.yaml @@ -5,10 +5,7 @@ metadata: name: {{ template "grafana.fullname" . }}-env namespace: {{ template "grafana.namespace" . }} labels: - app: {{ template "grafana.name" . }} - chart: {{ template "grafana.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + {{- include "grafana.labels" . | nindent 4 }} type: Opaque data: {{- range $key, $val := .Values.envRenderSecret }} diff --git a/stable/grafana/templates/secret.yaml b/stable/grafana/templates/secret.yaml index 2b1126cae0..f7ee9956b3 100644 --- a/stable/grafana/templates/secret.yaml +++ b/stable/grafana/templates/secret.yaml @@ -5,10 +5,7 @@ metadata: name: {{ template "grafana.fullname" . }} namespace: {{ template "grafana.namespace" . }} labels: - app: {{ template "grafana.name" . }} - chart: {{ template "grafana.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + {{- include "grafana.labels" . | nindent 4 }} type: Opaque data: admin-user: {{ .Values.adminUser | b64enc | quote }} diff --git a/stable/grafana/templates/service.yaml b/stable/grafana/templates/service.yaml index 70cc6639e5..e06c27df32 100644 --- a/stable/grafana/templates/service.yaml +++ b/stable/grafana/templates/service.yaml @@ -4,10 +4,7 @@ metadata: name: {{ template "grafana.fullname" . }} namespace: {{ template "grafana.namespace" . }} labels: - app: {{ template "grafana.name" . }} - chart: {{ template "grafana.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + {{- include "grafana.labels" . | nindent 4 }} {{- if .Values.service.labels }} {{ toYaml .Values.service.labels | indent 4 }} {{- end }} @@ -46,5 +43,4 @@ spec: nodePort: {{.Values.service.nodePort}} {{ end }} selector: - app: {{ template "grafana.name" . }} - release: {{ .Release.Name }} + {{- include "grafana.selectorLabels" . | nindent 4 }} diff --git a/stable/grafana/templates/serviceaccount.yaml b/stable/grafana/templates/serviceaccount.yaml index ba1d3692ed..7576eeef06 100644 --- a/stable/grafana/templates/serviceaccount.yaml +++ b/stable/grafana/templates/serviceaccount.yaml @@ -3,10 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: labels: - app: {{ template "grafana.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} + {{- include "grafana.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} annotations: {{ toYaml . | indent 4 }} diff --git a/stable/grafana/templates/statefulset.yaml b/stable/grafana/templates/statefulset.yaml index a24c5f7bcc..afc26b7c2f 100644 --- a/stable/grafana/templates/statefulset.yaml +++ b/stable/grafana/templates/statefulset.yaml @@ -5,10 +5,7 @@ metadata: name: {{ template "grafana.fullname" . }} namespace: {{ template "grafana.namespace" . }} labels: - app: {{ template "grafana.name" . }} - chart: {{ template "grafana.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} + {{- include "grafana.labels" . | nindent 4 }} {{- with .Values.annotations }} annotations: {{ toYaml . | indent 4 }} @@ -17,14 +14,12 @@ spec: replicas: {{ .Values.replicas }} selector: matchLabels: - app: {{ template "grafana.name" . }} - release: {{ .Release.Name }} + {{- include "grafana.selectorLabels" . | nindent 6 }} serviceName: {{ template "grafana.fullname" . }}-headless template: metadata: labels: - app: {{ template "grafana.name" . }} - release: {{ .Release.Name }} + {{- include "grafana.selectorLabels" . | nindent 8 }} annotations: checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} checksum/dashboards-json-config: {{ include (print $.Template.BasePath "/dashboards-json-configmap.yaml") . | sha256sum }} diff --git a/stable/grafana/templates/tests/test-configmap.yaml b/stable/grafana/templates/tests/test-configmap.yaml index 60a22eb9e6..ff53aaf1b3 100644 --- a/stable/grafana/templates/tests/test-configmap.yaml +++ b/stable/grafana/templates/tests/test-configmap.yaml @@ -5,16 +5,13 @@ metadata: name: {{ template "grafana.fullname" . }}-test namespace: {{ template "grafana.namespace" . }} labels: - app: {{ template "grafana.fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - heritage: "{{ .Release.Service }}" - release: "{{ .Release.Name }}" + {{- include "grafana.labels" . | nindent 4 }} data: run.sh: |- @test "Test Health" { url="http://{{ template "grafana.fullname" . }}/api/health" - code=$(curl -s -o /dev/null -I -w "%{http_code}" $url) + code=$(wget --server-response --spider --timeout 10 --tries 1 ${url} 2>&1 | awk '/^ HTTP/{print $2}') [ "$code" == "200" ] } {{- end }} diff --git a/stable/grafana/templates/tests/test-podsecuritypolicy.yaml b/stable/grafana/templates/tests/test-podsecuritypolicy.yaml index 0e12c7046e..eb5cbbcd70 100644 --- a/stable/grafana/templates/tests/test-podsecuritypolicy.yaml +++ b/stable/grafana/templates/tests/test-podsecuritypolicy.yaml @@ -5,10 +5,7 @@ metadata: name: {{ template "grafana.fullname" . }}-test namespace: {{ template "grafana.namespace" . }} labels: - app: {{ template "grafana.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} + {{- include "grafana.labels" . | nindent 4 }} spec: allowPrivilegeEscalation: true privileged: false diff --git a/stable/grafana/templates/tests/test-role.yaml b/stable/grafana/templates/tests/test-role.yaml index 7a443f4402..6b10677ae7 100644 --- a/stable/grafana/templates/tests/test-role.yaml +++ b/stable/grafana/templates/tests/test-role.yaml @@ -5,10 +5,7 @@ metadata: name: {{ template "grafana.fullname" . }}-test namespace: {{ template "grafana.namespace" . }} labels: - app: {{ template "grafana.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} + {{- include "grafana.labels" . | nindent 4 }} rules: - apiGroups: ['policy'] resources: ['podsecuritypolicies'] diff --git a/stable/grafana/templates/tests/test-rolebinding.yaml b/stable/grafana/templates/tests/test-rolebinding.yaml index fa9906655e..58fa5e78b5 100644 --- a/stable/grafana/templates/tests/test-rolebinding.yaml +++ b/stable/grafana/templates/tests/test-rolebinding.yaml @@ -5,10 +5,7 @@ metadata: name: {{ template "grafana.fullname" . }}-test namespace: {{ template "grafana.namespace" . }} labels: - app: {{ template "grafana.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} + {{- include "grafana.labels" . | nindent 4 }} roleRef: apiGroup: rbac.authorization.k8s.io kind: Role diff --git a/stable/grafana/templates/tests/test-serviceaccount.yaml b/stable/grafana/templates/tests/test-serviceaccount.yaml index 574f7391e1..5c33507337 100644 --- a/stable/grafana/templates/tests/test-serviceaccount.yaml +++ b/stable/grafana/templates/tests/test-serviceaccount.yaml @@ -3,10 +3,7 @@ apiVersion: v1 kind: ServiceAccount metadata: labels: - app: {{ template "grafana.name" . }} - chart: {{ .Chart.Name }}-{{ .Chart.Version }} - heritage: {{ .Release.Service }} - release: {{ .Release.Name }} + {{- include "grafana.labels" . | nindent 4 }} name: {{ template "grafana.serviceAccountNameTest" . }} namespace: {{ template "grafana.namespace" . }} {{- end }} diff --git a/stable/grafana/templates/tests/test.yaml b/stable/grafana/templates/tests/test.yaml index 997d2f9590..7b2475c62c 100644 --- a/stable/grafana/templates/tests/test.yaml +++ b/stable/grafana/templates/tests/test.yaml @@ -4,10 +4,7 @@ kind: Pod metadata: name: {{ template "grafana.fullname" . }}-test labels: - app: {{ template "grafana.fullname" . }} - chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" - heritage: "{{ .Release.Service }}" - release: "{{ .Release.Name }}" + {{- include "grafana.labels" . | nindent 4 }} annotations: "helm.sh/hook": test-success namespace: {{ template "grafana.namespace" . }} @@ -16,19 +13,6 @@ spec: {{- if .Values.testFramework.securityContext }} securityContext: {{ toYaml .Values.testFramework.securityContext | nindent 4 }} {{- end }} - initContainers: - - name: test-framework - image: "{{ .Values.testFramework.image}}:{{ .Values.testFramework.tag }}" - command: - - "bash" - - "-c" - - | - set -ex - # copy bats to tools dir - cp -R /usr/local/libexec/ /tools/bats/ - volumeMounts: - - mountPath: /tools - name: tools {{- if .Values.image.pullSecrets }} imagePullSecrets: {{- range .Values.image.pullSecrets }} @@ -50,18 +34,14 @@ spec: containers: - name: {{ .Release.Name }}-test image: "{{ .Values.testFramework.image}}:{{ .Values.testFramework.tag }}" - command: ["/tools/bats/bats", "-t", "/tests/run.sh"] + command: ["/opt/bats/bin/bats", "-t", "/tests/run.sh"] volumeMounts: - mountPath: /tests name: tests readOnly: true - - mountPath: /tools - name: tools volumes: - name: tests configMap: name: {{ template "grafana.fullname" . }}-test - - name: tools - emptyDir: {} restartPolicy: Never {{- end }} diff --git a/stable/grafana/values.yaml b/stable/grafana/values.yaml index 809047f531..181df09269 100644 --- a/stable/grafana/values.yaml +++ b/stable/grafana/values.yaml @@ -50,7 +50,7 @@ livenessProbe: image: repository: grafana/grafana - tag: 6.6.0 + tag: 6.6.1 pullPolicy: IfNotPresent ## Optionally specify an array of imagePullSecrets. @@ -62,8 +62,8 @@ image: testFramework: enabled: true - image: "dduportal/bats" - tag: "0.4.0" + image: "bats/bats" + tag: "v1.1.0" securityContext: {} securityContext: @@ -88,8 +88,8 @@ extraEmptyDirMounts: [] # priorityClassName: downloadDashboardsImage: - repository: appropriate/curl - tag: latest + repository: curlimages/curl + tag: 7.68.0 pullPolicy: IfNotPresent downloadDashboards: @@ -207,7 +207,7 @@ initChownData: ## image: repository: busybox - tag: "1.30" + tag: "1.31.1" pullPolicy: IfNotPresent ## initChownData resource requests and limits @@ -429,7 +429,7 @@ smtp: ## Sidecars that collect the configmaps with specified label and stores the included files them into the respective folders ## Requires at least Grafana 5 to work and can't be used together with parameters dashboardProviders, datasources and dashboards sidecar: - image: kiwigrid/k8s-sidecar:0.1.75 + image: kiwigrid/k8s-sidecar:0.1.99 imagePullPolicy: IfNotPresent resources: {} # limits: