Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bitnami/grafana-tempo] Add persistence options for Grafana Tempo metrics generator #31495

Merged
8 changes: 6 additions & 2 deletions bitnami/grafana-tempo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# Changelog

## 3.8.8 (2025-03-05)
## 4.0.0 (2025-03-10)

* [bitnami/grafana-tempo] Release 3.8.8 ([#32293](https://github.com/bitnami/charts/pull/32293))
* [bitnami/grafana-tempo] Add persistence options for Grafana Tempo metrics generator ([#31495](https://github.com/bitnami/charts/pull/31495))

## <small>3.8.8 (2025-03-05)</small>

* [bitnami/grafana-tempo] Release 3.8.8 (#32293) ([db224f4](https://github.com/bitnami/charts/commit/db224f45293da4a8d9ef81b3e1620272f4e83c8c)), closes [#32293](https://github.com/bitnami/charts/issues/32293)

## <small>3.8.7 (2025-02-19)</small>

Expand Down
2 changes: 1 addition & 1 deletion bitnami/grafana-tempo/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ maintainers:
name: grafana-tempo
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/grafana-tempo
version: 3.8.8
version: 4.0.0
19 changes: 18 additions & 1 deletion bitnami/grafana-tempo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,19 @@ The [Bitnami grafana-tempo](https://github.com/bitnami/containers/tree/main/bitn
| `metricsGenerator.pdb.maxUnavailable` | Maximum number/percentage of pods that may be made unavailable. Defaults to `1` if both `metricsGenerator.pdb.minAvailable` and `metricsGenerator.pdb.maxUnavailable` are empty. | `""` |
| `metricsGenerator.enableServiceLinks` | Whether information about services should be injected into pod's environment variable | `true` |

### Metrics Generator Persistence Parameters

| Name | Description | Value |
| -------------------------------------------- | -------------------------------------------------------------------------------- | ------------------- |
| `metricsGenerator.persistence.enabled` | Enable persistence in Metrics Generator instances | `false` |
| `metricsGenerator.persistence.existingClaim` | Name of an existing PVC to use | `""` |
| `metricsGenerator.persistence.storageClass` | PVC Storage Class for Metrics Generator data volume | `""` |
| `metricsGenerator.persistence.subPath` | The subdirectory of the volume to mount to | `""` |
| `metricsGenerator.persistence.accessModes` | PVC Access modes | `["ReadWriteOnce"]` |
| `metricsGenerator.persistence.size` | PVC Storage Request for Metrics Generator data volume | `8Gi` |
| `metricsGenerator.persistence.annotations` | Additional PVC annotations | `{}` |
| `metricsGenerator.persistence.selector` | Selector to match an existing Persistent Volume for Metrics Generator's data PVC | `{}` |

### Metrics Generator Traffic Exposure Parameters

| Name | Description | Value |
Expand Down Expand Up @@ -1109,6 +1122,10 @@ Find more information about how to deal with common errors related to Bitnami's

## Upgrading

### To 4.0.0

The `metrics-generator` component kind has switched from a 'Deployment' to a 'Statefulset'. More details at [Github issue](https://github.com/bitnami/charts/pull/31495).

### To 3.8.0

This version introduces image verification for security purposes. To disable it, set `global.security.allowInsecureImages` to `true`. More details at [GitHub issue](https://github.com/bitnami/charts/issues/30850).
Expand Down Expand Up @@ -1153,4 +1170,4 @@ Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SPDX-License-Identifier: APACHE-2.0
*/}}

apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
kind: StatefulSet
metadata:
name: {{ template "grafana-tempo.metrics-generator.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
Expand All @@ -16,12 +16,13 @@ metadata:
spec:
replicas: {{ .Values.metricsGenerator.replicaCount }}
{{- if .Values.metricsGenerator.updateStrategy }}
strategy: {{- toYaml .Values.metricsGenerator.updateStrategy | nindent 4 }}
updateStrategy: {{- toYaml .Values.metricsGenerator.updateStrategy | nindent 4 }}
{{- end }}
{{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.metricsGenerator.podLabels .Values.commonLabels ) "context" . ) }}
selector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: metrics-generator
serviceName: {{ template "grafana-tempo.metrics-generator.fullname" . }}
template:
metadata:
annotations:
Expand Down Expand Up @@ -70,6 +71,36 @@ spec:
{{- if .Values.metricsGenerator.initContainers }}
{{- include "common.tplvalues.render" (dict "value" .Values.metricsGenerator.initContainers "context" $) | nindent 8 }}
{{- end }}
{{- if and .Values.volumePermissions.enabled .Values.metricsGenerator.persistence.enabled }}
- name: volume-permissions
image: {{ include "grafana-tempo.volumePermissions.image" . }}
imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
command:
- /bin/bash
args:
- -ec
- |
mkdir -p {{ .Values.tempo.dataDir }}{{- if .Values.metricsGenerator.persistence.subPath }}/{{ .Values.metricsGenerator.persistence.subPath }}{{- end }}
{{- if and .Values.metricsGenerator.podSecurityContext.enabled .Values.metricsGenerator.containerSecurityContext.enabled }}
find {{ .Values.tempo.dataDir }}{{- if .Values.metricsGenerator.persistence.subPath }}/{{ .Values.metricsGenerator.persistence.subPath }}{{- end }} -mindepth 1 -maxdepth 1 -not -name ".snapshot" -not -name "lost+found" | xargs -r chown -R {{ .Values.metricsGenerator.containerSecurityContext.runAsUser }}:{{ .Values.metricsGenerator.podSecurityContext.fsGroup }}
{{- end }}
{{- if eq ( toString ( .Values.volumePermissions.containerSecurityContext.runAsUser )) "auto" }}
securityContext: {{- omit .Values.volumePermissions.containerSecurityContext "runAsUser" | toYaml | nindent 12 }}
{{- else }}
securityContext: {{- .Values.volumePermissions.containerSecurityContext | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.volumePermissions.resources }}
resources: {{- include "common.tplvalues.render" (dict "value" .Values.volumePermissions.resources "context" $) | nindent 12 }}
{{- else if ne .Values.volumePermissions.resourcesPreset "none" }}
resources: {{- include "common.resources.preset" (dict "type" .Values.volumePermissions.resourcesPreset) | nindent 12 }}
{{- end }}
volumeMounts:
- name: empty-dir
mountPath: /tmp
subPath: tmp-dir
- name: data
mountPath: {{ .Values.tempo.dataDir }}
{{- end }}
containers:
- name: grafana-tempo-metrics-generator
image: {{ template "grafana-tempo.image" . }}
Expand Down Expand Up @@ -164,8 +195,6 @@ spec:
volumes:
- name: empty-dir
emptyDir: {}
- name: data
emptyDir: {}
- name: tempo-config
configMap:
name: {{ template "grafana-tempo.tempoConfigmapName" . }}
Expand All @@ -175,3 +204,30 @@ spec:
{{- if .Values.metricsGenerator.extraVolumes }}
{{- include "common.tplvalues.render" (dict "value" .Values.metricsGenerator.extraVolumes "context" $) | nindent 8 }}
{{- end }}
{{- if not .Values.metricsGenerator.persistence.enabled }}
- name: data
emptyDir: {}
{{- else }}
volumeClaimTemplates:
- metadata:
name: data
{{- if or .Values.metricsGenerator.persistence.annotations .Values.commonAnnotations }}
{{- $claimAnnotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.metricsGenerator.persistence.annotations .Values.commonAnnotations ) "context" . ) }}
annotations: {{- include "common.tplvalues.render" ( dict "value" $claimAnnotations "context" $) | nindent 10 }}
{{- end }}
{{- if .Values.commonLabels }}
labels: {{- include "common.tplvalues.render" (dict "value" .Values.commonLabels "context" $) | nindent 10 }}
{{- end }}
spec:
accessModes:
{{- range .Values.metricsGenerator.persistence.accessModes }}
- {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.metricsGenerator.persistence.size | quote }}
{{- if .Values.metricsGenerator.persistence.selector }}
selector: {{- include "common.tplvalues.render" (dict "value" .Values.metricsGenerator.persistence.selector "context" $) | nindent 10 }}
{{- end }}
{{- include "common.storage.class" (dict "persistence" .Values.metricsGenerator.persistence "global" .Values.global) | nindent 8 }}
{{- end }}
42 changes: 42 additions & 0 deletions bitnami/grafana-tempo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1271,6 +1271,48 @@ metricsGenerator:
##
enableServiceLinks: true

## @section Metrics Generator Persistence Parameters

## Enable persistence using Persistent Volume Claims
## ref: https://kubernetes.io/docs/concepts/storage/persistent-volumes/
##
persistence:
## @param metricsGenerator.persistence.enabled Enable persistence in Metrics Generator instances
##
enabled: false
## @param metricsGenerator.persistence.existingClaim Name of an existing PVC to use
##
existingClaim: ""
## @param metricsGenerator.persistence.storageClass PVC Storage Class for Metrics Generator data volume
## If defined, storageClassName: <storageClass>
## If set to "-", storageClassName: "", which disables dynamic provisioning
## If undefined (the default) or set to null, no storageClassName spec is
## set, choosing the default provisioner. (gp2 on AWS, standard on
## GKE, AWS & OpenStack)
##
storageClass: ""
## @param metricsGenerator.persistence.subPath The subdirectory of the volume to mount to
##
subPath: ""
## @param metricsGenerator.persistence.accessModes PVC Access modes
##
accessModes:
- ReadWriteOnce
## @param metricsGenerator.persistence.size PVC Storage Request for Metrics Generator data volume
##
size: 8Gi
## @param metricsGenerator.persistence.annotations Additional PVC annotations
##
annotations: {}
## @param metricsGenerator.persistence.selector Selector to match an existing Persistent Volume for Metrics Generator's data PVC
## If set, the PVC can't have a PV dynamically provisioned for it
## E.g.
## selector:
## matchLabels:
## app: my-app
##
selector: {}

## @section Metrics Generator Traffic Exposure Parameters

## metricsGenerator service parameters
Expand Down
Loading