Skip to content

Commit

Permalink
Merge from main
Browse files Browse the repository at this point in the history
  • Loading branch information
7onn committed Jul 26, 2024
2 parents 216a2c4 + 357cc3e commit 56b6149
Show file tree
Hide file tree
Showing 58 changed files with 898 additions and 119 deletions.
6 changes: 3 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
# Unless a later match takes precedence, they will be requested for review when someone opens a pull request.
* @grafana/helm-charts-admins

/charts/grafana/ @maorfr @torstenwalter @Xtigyro @zanhsieh
/charts/grafana/ @jkroepke @maorfr @torstenwalter @Xtigyro @zanhsieh
/charts/loki-distributed/ @grafana/loki-squad @unguiculus @Whyeasy
/charts/loki-canary/ @grafana/loki-squad @unguiculus @Whyeasy
/charts/promtail/ @grafana/loki-squad @unguiculus @Whyeasy
/charts/tempo/ @grafana/tempo @dgzlopes @swartz-k @BitProcessor @faustodavid
/charts/tempo-distributed/ @grafana/tempo @mapno @swartz-k @BitProcessor @faustodavid
/charts/tempo/ @grafana/tempo @Sheikh-Abubaker @dgzlopes @swartz-k @BitProcessor @faustodavid
/charts/tempo-distributed/ @grafana/tempo @Sheikh-Abubaker @mapno @swartz-k @BitProcessor @faustodavid
/charts/enterprise-metrics/ @grafana/mimir-maintainers
/charts/rollout-operator/ @grafana/mimir-maintainers
/charts/enterprise-logs/ @grafana/loki-squad
Expand Down
10 changes: 5 additions & 5 deletions charts/agent-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ apiVersion: v2
name: grafana-agent-operator
description: A Helm chart for Grafana Agent Operator
type: application
version: 0.3.21
appVersion: "0.40.4"
home: https://grafana.com/docs/agent/v0.40/
icon: https://raw.githubusercontent.com/grafana/agent/v0.40.4/docs/sources/assets/logo_and_name.png
version: 0.4.1
appVersion: "0.42.0"
home: https://grafana.com/docs/agent/v0.42/
icon: https://raw.githubusercontent.com/grafana/agent/v0.42.0/docs/sources/assets/logo_and_name.png
sources:
- https://github.com/grafana/agent/tree/v0.40.4/pkg/operator
- https://github.com/grafana/agent/tree/v0.42.0/static/operator
maintainers:
- name: Grafana Agent Team
email: grafana-agent-team@googlegroups.com
6 changes: 3 additions & 3 deletions charts/agent-operator/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# grafana-agent-operator

![Version: 0.3.21](https://img.shields.io/badge/Version-0.3.21-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.40.4](https://img.shields.io/badge/AppVersion-0.40.4-informational?style=flat-square)
![Version: 0.4.1](https://img.shields.io/badge/Version-0.4.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.42.0](https://img.shields.io/badge/AppVersion-0.42.0-informational?style=flat-square)

A Helm chart for Grafana Agent Operator

⚠️ **Please create issues relating to this Helm chart in the [Agent](https://github.com/grafana/agent/issues) repo.**

## Source Code

* <https://github.com/grafana/agent/tree/v0.40.4/pkg/operator>
* <https://github.com/grafana/agent/tree/v0.42.0/static/operator>

Note that this chart does not provision custom resources like `GrafanaAgent` and `MetricsInstance` (formerly `PrometheusInstance`) or any `*Monitor` resources.

Expand Down Expand Up @@ -63,7 +63,7 @@ A major chart version change (like v1.2.3 -> v2.0.0) indicates that there is an
| image.pullSecrets | list | `[]` | Image pull secrets |
| image.registry | string | `"docker.io"` | Image registry |
| image.repository | string | `"grafana/agent-operator"` | Image repo |
| image.tag | string | `"v0.40.4"` | Image tag |
| image.tag | string | `"v0.42.0"` | Image tag |
| kubeletService | object | `{"namespace":"default","serviceName":"kubelet"}` | If both are set, Agent Operator will create and maintain a service for scraping kubelets https://grafana.com/docs/agent/latest/operator/getting-started/#monitor-kubelets |
| nameOverride | string | `""` | Overrides the chart's name |
| nodeSelector | object | `{}` | nodeSelector configuration |
Expand Down
1 change: 1 addition & 0 deletions charts/agent-operator/templates/operator-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "ga-operator.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{ include "ga-operator.labels" . | indent 4 }}
{{- with .Values.annotations }}
Expand Down
2 changes: 1 addition & 1 deletion charts/agent-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ image:
# -- Image repo
repository: grafana/agent-operator
# -- Image tag
tag: v0.40.4
tag: v0.42.0
# -- Image pull policy
pullPolicy: IfNotPresent
# -- Image pull secrets
Expand Down
6 changes: 4 additions & 2 deletions charts/grafana/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: grafana
version: 7.3.11
appVersion: 10.4.1
version: 8.3.6
appVersion: 11.1.0
kubeVersion: "^1.8.0-0"
description: The leading tool for querying and visualizing time series and metrics.
home: https://grafana.com
Expand All @@ -27,6 +27,8 @@ maintainers:
email: miroslav.hadzhiev@gmail.com
- name: torstenwalter
email: mail@torstenwalter.de
- name: jkroepke
email: github@jkroepke.de
type: application
keywords:
- monitoring
Expand Down
13 changes: 12 additions & 1 deletion charts/grafana/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ need to instead set `global.imageRegistry`.
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `image.pullSecrets` | Image pull secrets (can be templated) | `[]` |
| `service.enabled` | Enable grafana service | `true` |
| `service.ipFamilies` | Kubernetes service IP families | `[]` |
| `service.ipFamilyPolicy` | Kubernetes service IP family policy | `""` |
| `service.type` | Kubernetes service type | `ClusterIP` |
| `service.port` | Kubernetes port where service is exposed | `80` |
| `service.portName` | Name of the port on the service | `service` |
Expand Down Expand Up @@ -119,6 +121,7 @@ need to instead set `global.imageRegistry`.
| `persistence.subPath` | Mount a sub dir of the persistent volume (can be templated) | `nil` |
| `persistence.inMemory.enabled` | If persistence is not enabled, whether to mount the local storage in-memory to improve performance | `false` |
| `persistence.inMemory.sizeLimit` | SizeLimit for the in-memory local storage | `nil` |
| `persistence.disableWarning` | Hide NOTES warning, useful when persiting to a database | `false` |
| `initChownData.enabled` | If false, don't reset data ownership at startup | true |
| `initChownData.image.registry` | init-chown-data container image registry | `docker.io` |
| `initChownData.image.repository` | init-chown-data container image repository | `busybox` |
Expand Down Expand Up @@ -183,6 +186,7 @@ need to instead set `global.imageRegistry`.
| `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 | `""` |
| `sidecar.dashboards.provider.folderUid` | Allows you to specify the static UID for the logical folder above | `""` |
| `sidecar.dashboards.provider.disableDelete` | Activate to avoid the deletion of imported dashboards | `false` |
| `sidecar.dashboards.provider.allowUiUpdates` | Allow updating provisioned dashboards from the UI | `false` |
| `sidecar.dashboards.provider.type` | Provider type | `file` |
Expand Down Expand Up @@ -273,9 +277,13 @@ need to instead set `global.imageRegistry`.
| `imageRenderer.image.pullPolicy` | image-renderer ImagePullPolicy | `Always` |
| `imageRenderer.env` | extra env-vars for image-renderer | `{}` |
| `imageRenderer.envValueFrom` | Environment variables for image-renderer from alternate sources. See the API docs on [EnvVarSource](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.17/#envvarsource-v1-core) for format details. Can be templated | `{}` |
| `imageRenderer.extraConfigmapMounts` | Additional image-renderer configMap volume mounts (values are templated) | `[]` |
| `imageRenderer.extraSecretMounts` | Additional image-renderer secret volume mounts | `[]` |
| `imageRenderer.extraVolumeMounts` | Additional image-renderer volume mounts | `[]` |
| `imageRenderer.extraVolumes` | Additional image-renderer volumes | `[]` |
| `imageRenderer.serviceAccountName` | image-renderer deployment serviceAccountName | `""` |
| `imageRenderer.securityContext` | image-renderer deployment securityContext | `{}` |
| `imageRenderer.podAnnotations ` | image-renderer image-renderer pod annotation | `{}` |
| `imageRenderer.podAnnotations` | image-renderer image-renderer pod annotation | `{}` |
| `imageRenderer.hostAliases` | image-renderer deployment Host Aliases | `[]` |
| `imageRenderer.priorityClassName` | image-renderer deployment priority class | `''` |
| `imageRenderer.service.enabled` | Enable the image-renderer service | `true` |
Expand Down Expand Up @@ -437,6 +445,7 @@ Secrets are recommended over configmaps for this usecase because datasources usu
data like usernames and passwords. Secrets are the more appropriate cluster resource to manage those.

Example values to add a postgres datasource as a kubernetes secret:

```yaml
apiVersion: v1
kind: Secret
Expand Down Expand Up @@ -591,6 +600,7 @@ To delete provisioned alert rules is a two step process, you need to delete the
and then create a configuration which deletes the alert rule.
Example deletion configuration:
```yaml
apiVersion: v1
kind: ConfigMap
Expand All @@ -608,6 +618,7 @@ data:
```
## Statically provision alerting resources
If you don't need to change alerting resources (alert rules, contact points, notification policies and notification templates) regularly you could use the `alerting` config option instead of the sidecar option above.
This will grab the alerting config and apply it statically at build time for the helm file.

Expand Down
88 changes: 88 additions & 0 deletions charts/grafana/ci/with-image-renderer-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,91 @@ imageRenderer:
requests:
cpu: 500m
memory: 50Mi
extraVolumes:
- name: empty-renderer-volume
emtpyDir: {}
extraVolumeMounts:
- mountPath: /tmp/renderer
name: empty-renderer-volume
extraConfigmapMounts:
- name: renderer-config
mountPath: /usr/src/app/config.json
subPath: renderer-config.json
configMap: image-renderer-config
extraSecretMounts:
- name: renderer-certificate
mountPath: /usr/src/app/certs/
secretName: image-renderer-certificate
readOnly: true

extraObjects:
- apiVersion: v1
kind: ConfigMap
metadata:
name: image-renderer-config
data:
renderer-config.json: |
{
"service": {
"host": null,
"port": 8081,
"protocol": "http",
"certFile": "",
"certKey": "",
"metrics": {
"enabled": true,
"collectDefaultMetrics": true,
"requestDurationBuckets": [1, 5, 7, 9, 11, 13, 15, 20, 30]
},
"logging": {
"level": "info",
"console": {
"json": true,
"colorize": false
}
},
"security": {
"authToken": "-"
}
},
"rendering": {
"chromeBin": null,
"args": ["--no-sandbox", "--disable-gpu"],
"ignoresHttpsErrors": false,
"timezone": null,
"acceptLanguage": null,
"width": 1000,
"height": 500,
"deviceScaleFactor": 1,
"maxWidth": 3080,
"maxHeight": 3000,
"maxDeviceScaleFactor": 4,
"pageZoomLevel": 1,
"headed": false,
"mode": "default",
"emulateNetworkConditions": false,
"clustering": {
"monitor": false,
"mode": "browser",
"maxConcurrency": 5,
"timeout": 30
},
"verboseLogging": false,
"dumpio": false,
"timingMetrics": false
}
}
- apiVersion: v1
kind: Secret
metadata:
name: image-renderer-certificate
type: Opaque
data:
# Decodes to 'PLACEHOLDER CERTIFICATE'
not-a-real-certificate: UExBQ0VIT0xERVIgQ0VSVElGSUNBVEU=
38 changes: 38 additions & 0 deletions charts/grafana/ci/with-sidecars-envvaluefrom-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
extraObjects:
- apiVersion: v1
kind: ConfigMap
metadata:
name: '{{ include "grafana.fullname" . }}-test'
data:
var1: "value1"
- apiVersion: v1
kind: Secret
metadata:
name: '{{ include "grafana.fullname" . }}-test'
type: Opaque
data:
var2: "dmFsdWUy"

sidecar:
dashboards:
enabled: true
envValueFrom:
VAR1:
configMapKeyRef:
name: '{{ include "grafana.fullname" . }}-test'
key: var1
VAR2:
secretKeyRef:
name: '{{ include "grafana.fullname" . }}-test'
key: var2
datasources:
enabled: true
envValueFrom:
VAR1:
configMapKeyRef:
name: '{{ include "grafana.fullname" . }}-test'
key: var1
VAR2:
secretKeyRef:
name: '{{ include "grafana.fullname" . }}-test'
key: var2
2 changes: 1 addition & 1 deletion charts/grafana/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

3. Login with the password from step 1 and the username: {{ .Values.adminUser }}

{{- if not .Values.persistence.enabled }}
{{- if and (not .Values.persistence.enabled) (not .Values.persistence.disableWarning) }}
#################################################################################
###### WARNING: Persistence is disabled!!! You will lose your data when #####
###### the Grafana pod is terminated. #####
Expand Down
1 change: 1 addition & 0 deletions charts/grafana/templates/_config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ provider.yaml: |-
orgId: {{ .Values.sidecar.dashboards.provider.orgid }}
{{- if not .Values.sidecar.dashboards.provider.foldersFromFilesStructure }}
folder: '{{ .Values.sidecar.dashboards.provider.folder }}'
folderUid: '{{ .Values.sidecar.dashboards.provider.folderUid }}'
{{- end }}
type: {{ .Values.sidecar.dashboards.provider.type }}
disableDeletion: {{ .Values.sidecar.dashboards.provider.disableDelete }}
Expand Down
12 changes: 11 additions & 1 deletion charts/grafana/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ initContainers:
- name: "{{ $key }}"
value: "{{ $value }}"
{{- end }}
{{- range $key, $value := .Values.sidecar.datasources.envValueFrom }}
- name: {{ $key | quote }}
valueFrom:
{{- tpl (toYaml $value) $ | nindent 10 }}
{{- end }}
{{- if .Values.sidecar.datasources.ignoreAlreadyProcessed }}
- name: IGNORE_ALREADY_PROCESSED
value: "true"
Expand Down Expand Up @@ -434,7 +439,7 @@ containers:
- name: "{{ $key }}"
value: "{{ $value }}"
{{- end }}
{{- range $key, $value := .Values.sidecar.datasources.envValueFrom }}
{{- range $key, $value := .Values.sidecar.dashboards.envValueFrom }}
- name: {{ $key | quote }}
valueFrom:
{{- tpl (toYaml $value) $ | nindent 10 }}
Expand Down Expand Up @@ -550,6 +555,11 @@ containers:
- name: "{{ $key }}"
value: "{{ $value }}"
{{- end }}
{{- range $key, $value := .Values.sidecar.datasources.envValueFrom }}
- name: {{ $key | quote }}
valueFrom:
{{- tpl (toYaml $value) $ | nindent 10 }}
{{- end }}
{{- if .Values.sidecar.datasources.ignoreAlreadyProcessed }}
- name: IGNORE_ALREADY_PROCESSED
value: "true"
Expand Down
9 changes: 7 additions & 2 deletions charts/grafana/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ metadata:
namespace: {{ include "grafana.namespace" . }}
labels:
{{- include "grafana.labels" . | nindent 4 }}
{{- with .Values.annotations }}
{{- if or .Values.configMapAnnotations .Values.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- with .Values.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.configMapAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
data:
{{- include "grafana.configData" . | nindent 2 }}
Expand Down
Loading

0 comments on commit 56b6149

Please sign in to comment.