From da34bc740bf7a3e615ccefdacae0724fa5bc632c Mon Sep 17 00:00:00 2001 From: Brian Oldfield Date: Thu, 21 Nov 2024 14:41:07 -0800 Subject: [PATCH 1/3] Allow prefixing of rollout-group value and ingester name Signed-off-by: Brian Oldfield --- charts/tempo-distributed/README.md | 2 ++ .../templates/ingester/_helpers-ingester.tpl | 24 ++++++++++++++----- .../ingester/statefulset-ingester.yaml | 4 ++++ charts/tempo-distributed/values.yaml | 6 +++++ 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/charts/tempo-distributed/README.md b/charts/tempo-distributed/README.md index 7e3c752af5..b07d847cba 100755 --- a/charts/tempo-distributed/README.md +++ b/charts/tempo-distributed/README.md @@ -516,6 +516,7 @@ The memcached default args are removed and should be provided manually. The sett | global.image.registry | string | `"docker.io"` | Overrides the Docker registry globally for all images, excluding enterprise. | | global.priorityClassName | string | `nil` | Overrides the priorityClassName for all pods | | global_overrides | object | `{"per_tenant_override_config":"/runtime-config/overrides.yaml"}` | The standard overrides configuration section. This can include a `defaults` object for applying to all tenants (not to be confused with the `global` property of the same name, which overrides `max_byte_per_trace` for all tenants). For an example on how to enable the metrics generator using the `global_overrides` object, see the 'Activate metrics generator' section below. Refer to [Standard overrides](https://grafana.com/docs/tempo/latest/configuration/#standard-overrides) for more details. | +| ingester.addIngesterNamePrefix | bool | `false` | Optionally allow adding 'tempo-' prefix to Ingester StatefulSet names, this is helpful when running multiple LTGM components in a single namespace. | | ingester.affinity | string | Soft node and soft zone anti-affinity | Affinity for ingester pods. Passed through `tpl` and, thus, to be configured as string | | ingester.annotations | object | `{}` | Annotations for the ingester StatefulSet | | ingester.appProtocol | object | `{"grpc":null}` | Adds the appProtocol field to the ingester service. This allows ingester to work with istio protocol selection. | @@ -559,6 +560,7 @@ The memcached default args are removed and should be provided manually. The sett | ingester.priorityClassName | string | `nil` | The name of the PriorityClass for ingester pods | | ingester.replicas | int | `3` | Number of replicas for the ingester | | ingester.resources | object | `{}` | Resource requests and limits for the ingester | +| ingester.rolloutGroupPrefix | string | `null` | Optionally add supplied prefix to the Ingester StatefulSet rollout-group label. This is helpful when running multiple LTGM components in a single namespace. | | ingester.service.annotations | object | `{}` | Annotations for ingester service | | ingester.service.internalTrafficPolicy | string | `"Cluster"` | https://kubernetes.io/docs/concepts/services-networking/service-traffic-policy/ | | ingester.service.type | string | `"ClusterIP"` | Type of the service: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types | diff --git a/charts/tempo-distributed/templates/ingester/_helpers-ingester.tpl b/charts/tempo-distributed/templates/ingester/_helpers-ingester.tpl index f7018f507c..ec4928a62a 100644 --- a/charts/tempo-distributed/templates/ingester/_helpers-ingester.tpl +++ b/charts/tempo-distributed/templates/ingester/_helpers-ingester.tpl @@ -38,7 +38,7 @@ Params: - key: rollout-group operator: In values: - - ingester + - "{{ include "ingester.rolloutGroupNamePrefix" .ctx | trim }}{{ .component }}" - key: zone operator: NotIn values: @@ -70,8 +70,8 @@ ingester labels */}} {{- define "ingester.labels" -}} {{- if and .ctx.Values.ingester.zoneAwareReplication.enabled .rolloutZoneName }} -name: {{ printf "%s-%s" .component .rolloutZoneName }} -rollout-group: {{ .component }} +name: "{{ include "ingester.namePrefix" .ctx | trim }}{{ .component | trim }}-{{ .rolloutZoneName }}" +rollout-group: "{{ include "ingester.rolloutGroupNamePrefix" .ctx | trim }}{{ .component }}" zone: {{ .rolloutZoneName }} {{- end }} helm.sh/chart: {{ include "tempo.chart" .ctx }} @@ -123,7 +123,7 @@ app.kubernetes.io/component: {{ .component }} {{- if not .component }} {{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .rolloutZoneName | fail }} {{- end }} -rollout-group: {{ .component }} +rollout-group: "{{ include "ingester.rolloutGroupNamePrefix" .ctx | trim }}{{ .component }}" zone: {{ .rolloutZoneName }} {{- end }} {{- end -}} @@ -174,8 +174,20 @@ app.kubernetes.io/part-of: memberlist {{- if not .component }} {{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .rolloutZoneName | fail }} {{- end }} -name: "{{ .component }}-{{ .rolloutZoneName }}" {{- /* Currently required for rollout-operator. https://github.com/grafana/rollout-operator/issues/15 */}} -rollout-group: ingester +name: "{{ include "ingester.namePrefix" .ctx | trim }}{{ .component }}-{{ .rolloutZoneName }}"{{- /* Currently required for rollout-operator. https://github.com/grafana/rollout-operator/issues/15 */}} +rollout-group: "{{ include "ingester.rolloutGroupNamePrefix" .ctx | trim }}{{ .component }}" zone: {{ .rolloutZoneName }} {{- end }} {{- end -}} + +{{- define "ingester.rolloutGroupNamePrefix" -}} +{{- if .Values.ingester.rolloutGroupPrefix }} +{{ .Values.ingester.rolloutGroupPrefix }}- +{{- end }} +{{- end -}} + +{{- define "ingester.namePrefix" -}} +{{- if .Values.ingester.addNamePrefix }} +tempo- +{{- end }} +{{- end -}} diff --git a/charts/tempo-distributed/templates/ingester/statefulset-ingester.yaml b/charts/tempo-distributed/templates/ingester/statefulset-ingester.yaml index 2671a23994..c46a62204b 100644 --- a/charts/tempo-distributed/templates/ingester/statefulset-ingester.yaml +++ b/charts/tempo-distributed/templates/ingester/statefulset-ingester.yaml @@ -26,7 +26,11 @@ spec: selector: matchLabels: {{- include "ingester.selectorLabels" $dict | nindent 6}} + {{- if not .Values.ingester.zoneNamespacedServiceName }} serviceName: ingester + {{- else }} + serviceName: tempo-ingester-{{ $zoneName }} + {{- end }} podManagementPolicy: Parallel updateStrategy: {{- if .Values.ingester.zoneAwareReplication.enabled }} diff --git a/charts/tempo-distributed/values.yaml b/charts/tempo-distributed/values.yaml index 9d9bdde4b8..008858b616 100755 --- a/charts/tempo-distributed/values.yaml +++ b/charts/tempo-distributed/values.yaml @@ -302,6 +302,12 @@ ingester: # If set to "-", then use `storageClassName: ""`, which disables dynamic provisioning # If undefined or set to null (the default), then fall back to the value of `ingester.persistentVolume.storageClass`. storageClass: null + # optionally allow adding 'tempo-' prefix to ingester name label + addNamePrefix: false + # optionally allow adding arbitrary prefix to the ingester rollout-group label + rolloutGroupPrefix: '' + # optionally namespace StatefulSet serviceName with zone. ex: temp-ingester-zone-a + zoneNamespacedServiceName: false # Configuration for the metrics-generator metricsGenerator: From 1d14c7a8e6446c81e96d3d8d26de5aeb551bb37f Mon Sep 17 00:00:00 2001 From: Brian Oldfield Date: Fri, 22 Nov 2024 09:14:46 -0800 Subject: [PATCH 2/3] addressing doc lint issues Signed-off-by: Brian Oldfield --- charts/tempo-distributed/README.md | 4 +++- charts/tempo-distributed/values.yaml | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/charts/tempo-distributed/README.md b/charts/tempo-distributed/README.md index b07d847cba..988b98dbc8 100755 --- a/charts/tempo-distributed/README.md +++ b/charts/tempo-distributed/README.md @@ -517,6 +517,7 @@ The memcached default args are removed and should be provided manually. The sett | global.priorityClassName | string | `nil` | Overrides the priorityClassName for all pods | | global_overrides | object | `{"per_tenant_override_config":"/runtime-config/overrides.yaml"}` | The standard overrides configuration section. This can include a `defaults` object for applying to all tenants (not to be confused with the `global` property of the same name, which overrides `max_byte_per_trace` for all tenants). For an example on how to enable the metrics generator using the `global_overrides` object, see the 'Activate metrics generator' section below. Refer to [Standard overrides](https://grafana.com/docs/tempo/latest/configuration/#standard-overrides) for more details. | | ingester.addIngesterNamePrefix | bool | `false` | Optionally allow adding 'tempo-' prefix to Ingester StatefulSet names, this is helpful when running multiple LTGM components in a single namespace. | +| ingester.addNamePrefix | bool | `false` | Optionally allow adding 'tempo-' prefix to Ingester StatefulSet names, this is helpful when running multiple LTGM components in a single namespace. | | ingester.affinity | string | Soft node and soft zone anti-affinity | Affinity for ingester pods. Passed through `tpl` and, thus, to be configured as string | | ingester.annotations | object | `{}` | Annotations for the ingester StatefulSet | | ingester.appProtocol | object | `{"grpc":null}` | Adds the appProtocol field to the ingester service. This allows ingester to work with istio protocol selection. | @@ -560,7 +561,7 @@ The memcached default args are removed and should be provided manually. The sett | ingester.priorityClassName | string | `nil` | The name of the PriorityClass for ingester pods | | ingester.replicas | int | `3` | Number of replicas for the ingester | | ingester.resources | object | `{}` | Resource requests and limits for the ingester | -| ingester.rolloutGroupPrefix | string | `null` | Optionally add supplied prefix to the Ingester StatefulSet rollout-group label. This is helpful when running multiple LTGM components in a single namespace. | +| ingester.rolloutGroupPrefix | string | `""` | Optionally add supplied prefix to the Ingester StatefulSet rollout-group label. This is helpful when running multiple LTGM components in a single namespace. | | ingester.service.annotations | object | `{}` | Annotations for ingester service | | ingester.service.internalTrafficPolicy | string | `"Cluster"` | https://kubernetes.io/docs/concepts/services-networking/service-traffic-policy/ | | ingester.service.type | string | `"ClusterIP"` | Type of the service: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types | @@ -584,6 +585,7 @@ The memcached default args are removed and should be provided manually. The sett | ingester.zoneAwareReplication.zones[2].extraAffinity | object | `{}` | extraAffinity adds user defined custom affinity rules (merged with generated rules) | | ingester.zoneAwareReplication.zones[2].nodeSelector | string | `nil` | nodeselector to restrict where pods of this zone can be placed. E.g.: nodeSelector: topology.kubernetes.io/zone: zone-c | | ingester.zoneAwareReplication.zones[2].storageClass | string | `nil` | Ingester data Persistent Volume Storage Class If defined, storageClassName: If set to "-", then use `storageClassName: ""`, which disables dynamic provisioning If undefined or set to null (the default), then fall back to the value of `ingester.persistentVolume.storageClass`. | +| ingester.zoneNamespacedServiceName | bool | `false` | Optionally namespace StatefulSet serviceName with zone. ex: temp-ingester-zone-a | | license.contents | string | `"NOTAVALIDLICENSE"` | | | license.external | bool | `false` | | | license.secretName | string | `"{{ include \"tempo.resourceName\" (dict \"ctx\" . \"component\" \"license\") }}"` | | diff --git a/charts/tempo-distributed/values.yaml b/charts/tempo-distributed/values.yaml index 008858b616..e1ecddb3ed 100755 --- a/charts/tempo-distributed/values.yaml +++ b/charts/tempo-distributed/values.yaml @@ -302,11 +302,11 @@ ingester: # If set to "-", then use `storageClassName: ""`, which disables dynamic provisioning # If undefined or set to null (the default), then fall back to the value of `ingester.persistentVolume.storageClass`. storageClass: null - # optionally allow adding 'tempo-' prefix to ingester name label + # -- Optionally allow adding 'tempo-' prefix to Ingester StatefulSet names, this is helpful when running multiple LTGM components in a single namespace. addNamePrefix: false - # optionally allow adding arbitrary prefix to the ingester rollout-group label + # -- Optionally add supplied prefix to the Ingester StatefulSet rollout-group label. This is helpful when running multiple LTGM components in a single namespace. rolloutGroupPrefix: '' - # optionally namespace StatefulSet serviceName with zone. ex: temp-ingester-zone-a + # -- Optionally namespace StatefulSet serviceName with zone. ex: temp-ingester-zone-a zoneNamespacedServiceName: false # Configuration for the metrics-generator From b539ef76bcc4dbd1fcb8e53a9eabf1b4cc1ea94b Mon Sep 17 00:00:00 2001 From: Brian Oldfield Date: Thu, 12 Dec 2024 15:39:03 -0800 Subject: [PATCH 3/3] resolve version conflict Signed-off-by: Brian Oldfield --- charts/tempo-distributed/Chart.yaml | 2 +- charts/tempo-distributed/README.md | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/charts/tempo-distributed/Chart.yaml b/charts/tempo-distributed/Chart.yaml index 133401e1cc..e07d935bb3 100644 --- a/charts/tempo-distributed/Chart.yaml +++ b/charts/tempo-distributed/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: tempo-distributed description: Grafana Tempo in MicroService mode type: application -version: 1.28.0 +version: 1.29.0 appVersion: 2.6.0 engine: gotpl home: https://grafana.com/docs/tempo/latest/ diff --git a/charts/tempo-distributed/README.md b/charts/tempo-distributed/README.md index 988b98dbc8..f39484da52 100755 --- a/charts/tempo-distributed/README.md +++ b/charts/tempo-distributed/README.md @@ -1,6 +1,6 @@ # tempo-distributed -![Version: 1.28.0](https://img.shields.io/badge/Version-1.28.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.6.0](https://img.shields.io/badge/AppVersion-2.6.0-informational?style=flat-square) +![Version: 1.29.0](https://img.shields.io/badge/Version-1.29.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.6.0](https://img.shields.io/badge/AppVersion-2.6.0-informational?style=flat-square) Grafana Tempo in MicroService mode @@ -516,7 +516,6 @@ The memcached default args are removed and should be provided manually. The sett | global.image.registry | string | `"docker.io"` | Overrides the Docker registry globally for all images, excluding enterprise. | | global.priorityClassName | string | `nil` | Overrides the priorityClassName for all pods | | global_overrides | object | `{"per_tenant_override_config":"/runtime-config/overrides.yaml"}` | The standard overrides configuration section. This can include a `defaults` object for applying to all tenants (not to be confused with the `global` property of the same name, which overrides `max_byte_per_trace` for all tenants). For an example on how to enable the metrics generator using the `global_overrides` object, see the 'Activate metrics generator' section below. Refer to [Standard overrides](https://grafana.com/docs/tempo/latest/configuration/#standard-overrides) for more details. | -| ingester.addIngesterNamePrefix | bool | `false` | Optionally allow adding 'tempo-' prefix to Ingester StatefulSet names, this is helpful when running multiple LTGM components in a single namespace. | | ingester.addNamePrefix | bool | `false` | Optionally allow adding 'tempo-' prefix to Ingester StatefulSet names, this is helpful when running multiple LTGM components in a single namespace. | | ingester.affinity | string | Soft node and soft zone anti-affinity | Affinity for ingester pods. Passed through `tpl` and, thus, to be configured as string | | ingester.annotations | object | `{}` | Annotations for the ingester StatefulSet |