added repo

This commit is contained in:
Your Name
2026-08-26 03:39:42 +05:30
parent 45c25a95af
commit b8575bb8b9
6889 changed files with 1217125 additions and 0 deletions
@@ -0,0 +1,21 @@
***********************************************************************
Welcome to Grafana Tempo
Chart version: {{ .Chart.Version }}
Tempo version: {{ .Chart.AppVersion }}
***********************************************************************
Installed components:
* ingester
* distributor
* querier
* query-frontend
{{- if .Values.enterpriseFederationFrontend.enabled }}
* federation-frontend
{{- end }}
* compactor
{{- if .Values.memcached.enabled }}
* memcached
{{- end }}
{{- if .Values.gateway.enabled }}
* gateway
{{- end }}
@@ -0,0 +1,300 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "tempo.name" -}}
{{- default "tempo" .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "tempo.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default "tempo" .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Docker image selector for Tempo. Hierachy based on global, component, and tempo values.
*/}}
{{- define "tempo.tempoImage" -}}
{{- $registry := coalesce .global.registry .component.registry .tempo.registry -}}
{{- $repository := coalesce .component.repository .tempo.repository -}}
{{- $tag := coalesce .component.tag .tempo.tag .defaultVersion | toString -}}
{{- printf "%s/%s:%s" $registry $repository $tag -}}
{{- end -}}
{{/*
Optional list of imagePullSecrets for Tempo docker images
*/}}
{{- define "tempo.imagePullSecrets" -}}
{{- $imagePullSecrets := coalesce .global.pullSecrets .component.pullSecrets .tempo.pullSecrets -}}
{{- if $imagePullSecrets -}}
imagePullSecrets:
{{- range $imagePullSecrets }}
- name: {{ . }}
{{ end }}
{{- end }}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "tempo.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Calculate image name based on whether enterprise features are requested. Fallback to hierarchy handling in `tempo.tempoImage`.
*/}}
{{- define "tempo.imageReference" -}}
{{ $tempo := "" }}
{{- if .ctx.Values.enterprise.enabled -}}
{{ $tempo = merge .ctx.Values.enterprise.image .ctx.Values.tempo.image }}
{{- else -}}
{{ $tempo = .ctx.Values.tempo.image }}
{{- end -}}
{{- $componentSection := include "tempo.componentSectionFromName" . }}
{{- if not (hasKey .ctx.Values $componentSection) }}
{{- print "Component section " $componentSection " does not exist" | fail }}
{{- end }}
{{- $component := (index .ctx.Values $componentSection).image | default dict }}
{{- $dict := dict "tempo" $tempo "component" $component "global" .ctx.Values.global.image "defaultVersion" .ctx.Chart.AppVersion -}}
{{- include "tempo.tempoImage" $dict -}}
{{- end -}}
{{/*
Simple resource labels
*/}}
{{- define "tempo.labels" -}}
helm.sh/chart: {{ include "tempo.chart" .ctx }}
app.kubernetes.io/name: {{ include "tempo.name" .ctx }}
app.kubernetes.io/instance: {{ .ctx.Release.Name }}
{{- if .component }}
app.kubernetes.io/component: {{ .component }}
{{- end }}
{{- if .memberlist }}
app.kubernetes.io/part-of: memberlist
{{- end }}
{{- if .ctx.Chart.AppVersion }}
app.kubernetes.io/version: {{ .ctx.Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .ctx.Release.Service }}
{{- end -}}
{{/*
Simple service selector labels
*/}}
{{- define "tempo.selectorLabels" -}}
app.kubernetes.io/name: {{ include "tempo.name" .ctx }}
app.kubernetes.io/instance: {{ .ctx.Release.Name }}
{{- if .component }}
app.kubernetes.io/component: {{ .component }}
{{- end -}}
{{- end -}}
{{/*
Create the name of the service account to use
*/}}
{{- define "tempo.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "tempo.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Return the appropriate apiVersion for ingress.
*/}}
{{- define "tempo.ingress.apiVersion" -}}
{{- if and (.Capabilities.APIVersions.Has "networking.k8s.io/v1") (semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version) -}}
{{- print "networking.k8s.io/v1" -}}
{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" -}}
{{- print "networking.k8s.io/v1beta1" -}}
{{- else -}}
{{- print "extensions/v1beta1" -}}
{{- end -}}
{{- end -}}
{{/*
Return if ingress is stable.
*/}}
{{- define "tempo.ingress.isStable" -}}
{{- eq (include "tempo.ingress.apiVersion" .) "networking.k8s.io/v1" -}}
{{- end -}}
{{/*
Return if ingress supports ingressClassName.
*/}}
{{- define "tempo.ingress.supportsIngressClassName" -}}
{{- or (eq (include "tempo.ingress.isStable" .) "true") (and (eq (include "tempo.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) -}}
{{- end -}}
{{/*
Return if ingress supports pathType.
*/}}
{{- define "tempo.ingress.supportsPathType" -}}
{{- or (eq (include "tempo.ingress.isStable" .) "true") (and (eq (include "tempo.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) -}}
{{- end -}}
{{/*
Return the appropriate apiVersion for PodDisruptionBudget.
*/}}
{{- define "tempo.pdb.apiVersion" -}}
{{- if and (.Capabilities.APIVersions.Has "policy/v1") (semverCompare ">=1.21-0" .Capabilities.KubeVersion.Version) -}}
{{- print "policy/v1" -}}
{{- else -}}
{{- print "policy/v1beta1" -}}
{{- end -}}
{{- end -}}
{{/*
Return the appropriate apiVersion for HorizontalPodAutoscaler.
*/}}
{{- define "tempo.hpa.apiVersion" -}}
{{- if and (.Capabilities.APIVersions.Has "autoscaling/v2") (semverCompare ">=1.23-0" .Capabilities.KubeVersion.Version) -}}
{{- print "autoscaling/v2" -}}
{{- else -}}
{{- print "autoscaling/v2beta1" -}}
{{- end -}}
{{- end -}}
{{/*
Resource name template
*/}}
{{- define "tempo.resourceName" -}}
{{ include "tempo.fullname" .ctx }}{{- if .component -}}-{{ .component }}{{- end -}}
{{- end -}}
{{/*
Calculate the config from structured and unstructured text input
*/}}
{{- define "tempo.calculatedConfig" -}}
{{ tpl (mergeOverwrite (tpl .Values.config . | fromYaml) .Values.tempo.structuredConfig | toYaml) . }}
{{- end -}}
{{/*
Renders the overrides config
*/}}
{{- define "tempo.overridesConfig" -}}
overrides:
{{ toYaml .Values.overrides | indent 2 }}
{{- end -}}
{{/*
The volume to mount for tempo configuration
*/}}
{{- define "tempo.configVolume" -}}
{{- if eq .Values.configStorageType "Secret" -}}
secret:
secretName: {{ tpl .Values.externalConfigSecretName . }}
{{- else if eq .Values.configStorageType "ConfigMap" -}}
configMap:
name: {{ tpl .Values.externalConfigSecretName . }}
items:
- key: "tempo.yaml"
path: "tempo.yaml"
{{- if .Values.queryFrontend.query.enabled }}
- key: "tempo-query.yaml"
path: "tempo-query.yaml"
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
The volume to mount for tempo runtime configuration
*/}}
{{- define "tempo.runtimeVolume" -}}
configMap:
name: {{ tpl .Values.externalRuntimeConfigName . }}
items:
- key: "overrides.yaml"
path: "overrides.yaml"
{{- end -}}
{{/*
Internal servers http listen port - derived from Loki default
*/}}
{{- define "tempo.serverHttpListenPort" -}}
{{ (((.Values.tempo).structuredConfig).server).http_listen_port | default "3100" }}
{{- end -}}
{{/*
Internal servers grpc listen port - derived from Tempo default
*/}}
{{- define "tempo.serverGrpcListenPort" -}}
{{ (((.Values.tempo).structuredConfig).server).grpc_listen_port | default "9095" }}
{{- end -}}
{{/*
Memberlist bind port
*/}}
{{- define "tempo.memberlistBindPort" -}}
{{ (((.Values.tempo).structuredConfig).memberlist).bind_port | default "7946" }}
{{- end -}}
{{/*
Calculate values.yaml section name from component name
Expects the component name in .component on the passed context
*/}}
{{- define "tempo.componentSectionFromName" -}}
{{- .component | replace "-" "_" | camelcase | untitle -}}
{{- end -}}
{{/*
POD labels
*/}}
{{- define "tempo.podLabels" -}}
helm.sh/chart: {{ include "tempo.chart" .ctx }}
app.kubernetes.io/name: {{ include "tempo.name" .ctx }}
app.kubernetes.io/instance: {{ .ctx.Release.Name }}
app.kubernetes.io/version: {{ .ctx.Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .ctx.Release.Service }}
{{- if .component }}
app.kubernetes.io/component: {{ .component }}
{{- end }}
{{- if .memberlist }}
app.kubernetes.io/part-of: memberlist
{{- end -}}
{{- end -}}
{{/*
POD annotations
*/}}
{{- define "tempo.podAnnotations" -}}
{{- if .ctx.Values.useExternalConfig }}
checksum/config: {{ .ctx.Values.externalConfigVersion }}
{{- else -}}
checksum/config: {{ include (print .ctx.Template.BasePath "/configmap-tempo.yaml") .ctx | sha256sum }}
{{- end }}
{{- with .ctx.Values.global.podAnnotations }}
{{ toYaml . }}
{{- end }}
{{- if .component }}
{{- $componentSection := include "tempo.componentSectionFromName" . }}
{{- if not (hasKey .ctx.Values $componentSection) }}
{{- print "Component section " $componentSection " does not exist" | fail }}
{{- end }}
{{- with (index .ctx.Values $componentSection).podAnnotations }}
{{ toYaml . }}
{{- end }}
{{- end }}
{{- end -}}
{{/*
Cluster name that shows up in dashboard metrics
*/}}
{{- define "tempo.clusterName" -}}
{{ (include "tempo.calculatedConfig" . | fromYaml).cluster_name | default .Release.Name }}
{{- end -}}
@@ -0,0 +1,7 @@
{{/*
adminApi imagePullSecrets
*/}}
{{- define "tempo.adminApiImagePullSecrets" -}}
{{- $dict := dict "tempo" .Values.tempo.image "component" .Values.adminApi.image "global" .Values.global.image -}}
{{- include "tempo.imagePullSecrets" $dict -}}
{{- end }}
@@ -0,0 +1,131 @@
{{- if .Values.enterprise.enabled -}}
{{ $dict := dict "ctx" . "component" "admin-api" "memberlist" true }}
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
{{- toYaml .Values.adminApi.annotations | nindent 4 }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
name: {{ include "tempo.resourceName" $dict }}
namespace: {{ .Release.Namespace | quote }}
spec:
replicas: {{ .Values.adminApi.replicas }}
selector:
matchLabels:
{{- include "tempo.selectorLabels" $dict | nindent 6 }}
strategy:
{{- toYaml .Values.adminApi.strategy | nindent 4 }}
template:
metadata:
labels:
{{- include "tempo.podLabels" $dict | nindent 8 }}
{{- with .Values.adminApi.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
{{- include "tempo.podAnnotations" $dict | nindent 8 }}
namespace: {{ .Release.Namespace | quote }}
spec:
serviceAccountName: {{ template "tempo.serviceAccountName" . }}
{{- if .Values.adminApi.priorityClassName }}
priorityClassName: {{ .Values.adminApi.priorityClassName }}
{{- end }}
securityContext:
{{- toYaml .Values.adminApi.securityContext | nindent 8 }}
initContainers:
{{- with .Values.adminApi.initContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "tempo.adminApiImagePullSecrets" . | nindent 6 -}}
{{- with .Values.adminApi.hostAliases }}
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: admin-api
image: "{{ include "tempo.imageReference" $dict }}"
imagePullPolicy: {{ .Values.tempo.image.pullPolicy }}
args:
- "-target=admin-api"
- "-config.expand-env=true"
- "-config.file=/conf/tempo.yaml"
{{- range $key, $value := .Values.adminApi.extraArgs }}
- "-{{ $key }}={{ $value }}"
{{- end }}
volumeMounts:
- mountPath: /conf
name: config
- name: license
mountPath: /license
- name: storage
mountPath: "/data"
subPath: {{ .Values.adminApi.persistence.subPath }}
{{- if .Values.adminApi.extraVolumeMounts }}
{{ toYaml .Values.adminApi.extraVolumeMounts | nindent 12}}
{{- end }}
ports:
- name: http-metrics
containerPort: {{ include "tempo.serverHttpListenPort" . }}
protocol: TCP
- name: grpc
containerPort: {{ include "tempo.serverGrpcListenPort" . }}
protocol: TCP
- name: memberlist
containerPort: {{ include "tempo.memberlistBindPort" . }}
protocol: TCP
livenessProbe:
{{- toYaml .Values.adminApi.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml .Values.adminApi.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.adminApi.resources | nindent 12 }}
securityContext:
{{- toYaml .Values.adminApi.containerSecurityContext | nindent 12 }}
env:
{{- with .Values.global.extraEnv }}
{{ toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.adminApi.env }}
{{ toYaml . | nindent 12 }}
{{- end }}
envFrom:
{{- with .Values.global.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.adminApi.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.adminApi.extraContainers }}
{{ toYaml . | nindent 8 }}
{{- end }}
nodeSelector:
{{- toYaml .Values.adminApi.nodeSelector | nindent 8 }}
{{- if semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.adminApi.topologySpreadConstraints }}
topologySpreadConstraints:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.adminApi.affinity }}
affinity:
{{- tpl . $ | nindent 8 }}
{{- end }}
tolerations:
{{- toYaml .Values.adminApi.tolerations | nindent 8 }}
terminationGracePeriodSeconds: {{ .Values.adminApi.terminationGracePeriodSeconds }}
volumes:
- name: config
{{- include "tempo.configVolume" . | nindent 10 }}
- name: runtime-config
configMap:
name: {{ template "tempo.fullname" . }}-runtime
{{- if .Values.adminApi.extraVolumes }}
{{ toYaml .Values.adminApi.extraVolumes | nindent 8}}
{{- end }}
- name: license
secret:
secretName: {{ tpl .Values.license.secretName . }}
- name: storage
emptyDir: {}
{{- end -}}
@@ -0,0 +1,3 @@
{{- if .Values.enterprise.enabled -}}
{{- include "tempo.lib.podDisruptionBudget" (dict "ctx" $ "component" "admin-api" "memberlist" true) }}
{{- end -}}
@@ -0,0 +1,3 @@
{{- if .Values.enterprise.enabled -}}
{{- include "tempo.lib.serviceMonitor" (dict "ctx" . "component" "admin-api" "memberlist" true) }}
{{- end -}}
@@ -0,0 +1,27 @@
{{- if .Values.enterprise.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" . "component" "admin-api") }}
labels:
{{- include "tempo.labels" (dict "ctx" . "component" "admin-api" "memberlist" true) | nindent 4 }}
{{- with .Values.adminApi.service.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
annotations:
{{- toYaml .Values.adminApi.service.annotations | nindent 4 }}
namespace: {{ .Release.Namespace | quote }}
spec:
type: ClusterIP
ports:
- port: {{ include "tempo.serverHttpListenPort" . }}
protocol: TCP
name: http-metrics
targetPort: http-metrics
- port: {{ include "tempo.serverGrpcListenPort" . }}
protocol: TCP
name: grpc
targetPort: grpc
selector:
{{- include "tempo.selectorLabels" (dict "ctx" . "component" "admin-api" "memberlist" true) | nindent 4 }}
{{- end -}}
@@ -0,0 +1,7 @@
{{/*
compactor imagePullSecrets
*/}}
{{- define "tempo.compactorImagePullSecrets" -}}
{{- $dict := dict "tempo" .Values.tempo.image "component" .Values.compactor.image "global" .Values.global.image -}}
{{- include "tempo.imagePullSecrets" $dict -}}
{{- end }}
@@ -0,0 +1,140 @@
{{ $dict := dict "ctx" . "component" "compactor" "memberlist" true }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "tempo.resourceName" $dict }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
{{- with .Values.compactor.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
minReadySeconds: 10
replicas: {{ .Values.compactor.replicas }}
revisionHistoryLimit: 10
selector:
matchLabels:
{{- include "tempo.selectorLabels" $dict | nindent 6 }}
strategy:
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
template:
metadata:
labels:
{{- include "tempo.podLabels" $dict | nindent 8 }}
{{- with .Values.tempo.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.compactor.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap-tempo.yaml") . | sha256sum }}
{{- with .Values.tempo.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.compactor.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if or (.Values.compactor.priorityClassName) (.Values.global.priorityClassName) }}
priorityClassName: {{ default .Values.compactor.priorityClassName .Values.global.priorityClassName }}
{{- end }}
serviceAccountName: {{ include "tempo.serviceAccountName" . }}
{{- with .Values.tempo.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
enableServiceLinks: false
{{- include "tempo.compactorImagePullSecrets" . | nindent 6 -}}
{{- with .Values.compactor.hostAliases }}
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- args:
- -target=compactor
- -config.file=/conf/tempo.yaml
- -mem-ballast-size-mbs=1024
{{- with .Values.compactor.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
image: {{ include "tempo.imageReference" $dict }}
imagePullPolicy: {{ .Values.tempo.image.pullPolicy }}
name: compactor
ports:
- containerPort: 3100
name: http-metrics
- containerPort: {{ include "tempo.memberlistBindPort" . }}
name: http-memberlist
{{- with .Values.compactor.extraEnv }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.compactor.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.compactor.resources | nindent 12 }}
{{- with .Values.tempo.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- mountPath: /conf
name: config
- mountPath: /runtime-config
name: runtime-config
- mountPath: /var/tempo
name: tempo-compactor-store
{{- if .Values.enterprise.enabled }}
- name: license
mountPath: /license
{{- end }}
{{- with .Values.compactor.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.compactor.terminationGracePeriodSeconds }}
{{- if semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.compactor.topologySpreadConstraints }}
topologySpreadConstraints:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.compactor.affinity }}
affinity:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- with .Values.compactor.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.compactor.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.compactor.dnsConfigOverides.enabled }}
{{- with .Values.compactor.dnsConfigOverides.dnsConfig }}
dnsConfig:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
volumes:
- name: config
{{- include "tempo.configVolume" . | nindent 10 }}
- name: runtime-config
{{- include "tempo.runtimeVolume" . | nindent 10 }}
- name: tempo-compactor-store
emptyDir: {}
{{- if .Values.enterprise.enabled }}
- name: license
secret:
secretName: {{ tpl .Values.license.secretName . }}
{{- end }}
{{- with .Values.compactor.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
@@ -0,0 +1,14 @@
{{- if gt (int .Values.compactor.replicas) 1 }}
{{ $dict := dict "ctx" . "component" "compactor" "memberlist" true }}
apiVersion: {{ include "tempo.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ include "tempo.resourceName" $dict }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "tempo.selectorLabels" $dict | nindent 6 }}
maxUnavailable: 1
{{- end }}
@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "tempo.resourceName" (dict "ctx" . "component" "compactor") }}
labels:
{{- include "tempo.labels" (dict "ctx" . "component" "compactor") | nindent 4 }}
{{- with .Values.compactor.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: ClusterIP
ports:
- name: http-metrics
port: 3100
targetPort: 3100
protocol: TCP
selector:
{{- include "tempo.selectorLabels" (dict "ctx" . "component" "compactor") | nindent 4 }}
@@ -0,0 +1 @@
{{- include "tempo.lib.serviceMonitor" (dict "ctx" $ "component" "compactor" "memberlist" true) }}
@@ -0,0 +1,12 @@
{{- if not .Values.useExternalConfig }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ tpl .Values.externalRuntimeConfigName . }}
labels:
{{- include "tempo.labels" (dict "ctx" .) | nindent 4 }}
namespace: {{ .Release.Namespace | quote }}
data:
overrides.yaml: |
{{ include "tempo.overridesConfig" . | nindent 4 }}
{{- end }}
@@ -0,0 +1,24 @@
{{- if not .Values.useExternalConfig }}
apiVersion: v1
{{- if eq .Values.configStorageType "Secret" }}
kind: Secret
{{- else }}
kind: ConfigMap
{{- end }}
metadata:
name: {{ tpl .Values.externalConfigSecretName . }}
labels:
{{- include "tempo.labels" (dict "ctx" .) | nindent 4 }}
namespace: {{ .Release.Namespace | quote }}
{{- if eq .Values.configStorageType "Secret" }}
data:
tempo-query.yaml: {{ tpl .Values.queryFrontend.query.config . | b64enc }}
tempo.yaml: {{ include "tempo.calculatedConfig" . | b64enc }}
{{- else }}
data:
tempo-query.yaml: |
{{- tpl .Values.queryFrontend.query.config . | nindent 4 }}
tempo.yaml: |
{{ include "tempo.calculatedConfig" . | nindent 4 }}
{{- end -}}
{{- end }}
@@ -0,0 +1,7 @@
{{/*
distributor imagePullSecrets
*/}}
{{- define "tempo.distributorImagePullSecrets" -}}
{{- $dict := dict "tempo" .Values.tempo.image "component" .Values.distributor.image "global" .Values.global.image -}}
{{- include "tempo.imagePullSecrets" $dict -}}
{{- end }}
@@ -0,0 +1,175 @@
{{ $dict := dict "ctx" . "component" "distributor" "memberlist" true }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "tempo.resourceName" $dict }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
{{- with .Values.distributor.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
minReadySeconds: 10
{{- if not .Values.distributor.autoscaling.enabled }}
replicas: {{ .Values.distributor.replicas }}
{{- end }}
revisionHistoryLimit: 10
selector:
matchLabels:
{{- include "tempo.selectorLabels" $dict | nindent 6 }}
template:
metadata:
labels:
{{- include "tempo.podLabels" $dict | nindent 8 }}
{{- with .Values.tempo.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.distributor.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap-tempo.yaml") . | sha256sum }}
{{- with .Values.tempo.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.distributor.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if or (.Values.distributor.priorityClassName) (.Values.global.priorityClassName) }}
priorityClassName: {{ default .Values.distributor.priorityClassName .Values.global.priorityClassName }}
{{- end }}
serviceAccountName: {{ include "tempo.serviceAccountName" . }}
{{- with .Values.tempo.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
enableServiceLinks: false
{{- include "tempo.distributorImagePullSecrets" . | nindent 6 -}}
{{- with .Values.distributor.hostAliases }}
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- args:
- -target=distributor
- -config.file=/conf/tempo.yaml
- -mem-ballast-size-mbs=1024
{{- with .Values.distributor.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
image: {{ include "tempo.imageReference" $dict }}
imagePullPolicy: {{ .Values.tempo.image.pullPolicy }}
name: distributor
ports:
- containerPort: {{ include "tempo.memberlistBindPort" . }}
name: http-memberlist
protocol: TCP
- containerPort: 3100
name: http-metrics
{{- if .Values.traces.jaeger.thriftCompact.enabled }}
- containerPort: 6831
name: jaeger-compact
protocol: UDP
{{- end }}
{{- if .Values.traces.jaeger.thriftBinary.enabled }}
- containerPort: 6832
name: jaeger-binary
protocol: UDP
{{- end }}
{{- if .Values.traces.jaeger.thriftHttp.enabled }}
- containerPort: 14268
name: jaeger-http
protocol: TCP
{{- end }}
{{- if .Values.traces.jaeger.grpc.enabled }}
- containerPort: 14250
name: grpc-jaeger
protocol: TCP
{{- end }}
{{- if .Values.traces.zipkin.enabled }}
- containerPort: 9411
name: zipkin
protocol: TCP
{{- end }}
{{- if .Values.traces.otlp.http.enabled }}
- containerPort: 4318
name: otlp-http
protocol: TCP
{{- end }}
{{- if .Values.traces.otlp.grpc.enabled }}
- containerPort: 4317
name: grpc-otlp
protocol: TCP
{{- end }}
{{- if .Values.traces.opencensus.enabled }}
- containerPort: 55678
name: opencensus
protocol: TCP
{{- end }}
{{- with .Values.distributor.extraEnv }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.distributor.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
readinessProbe:
{{- toYaml .Values.tempo.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.distributor.resources | nindent 12 }}
{{- with .Values.tempo.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- mountPath: /conf
name: config
- mountPath: /runtime-config
name: runtime-config
- mountPath: /var/tempo
name: tempo-distributor-store
{{- if .Values.enterprise.enabled }}
- name: license
mountPath: /license
{{- end }}
{{- with .Values.distributor.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.distributor.terminationGracePeriodSeconds }}
{{- if semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.distributor.topologySpreadConstraints }}
topologySpreadConstraints:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.distributor.affinity }}
affinity:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- with .Values.distributor.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.distributor.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: config
{{- include "tempo.configVolume" . | nindent 10 }}
- name: runtime-config
{{- include "tempo.runtimeVolume" . | nindent 10 }}
- name: tempo-distributor-store
emptyDir: {}
{{- if .Values.enterprise.enabled }}
- name: license
secret:
secretName: {{ tpl .Values.license.secretName . }}
{{- end }}
{{- with .Values.distributor.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
@@ -0,0 +1,45 @@
{{- if .Values.distributor.autoscaling.enabled }}
{{- $apiVersion := include "tempo.hpa.apiVersion" . -}}
apiVersion: {{ $apiVersion }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" . "component" "distributor") }}
labels:
{{- include "tempo.labels" (dict "ctx" . "component" "distributor") | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "tempo.resourceName" (dict "ctx" . "component" "distributor") }}
minReplicas: {{ .Values.distributor.autoscaling.minReplicas }}
maxReplicas: {{ .Values.distributor.autoscaling.maxReplicas }}
{{- with .Values.distributor.autoscaling.behavior }}
behavior:
{{- toYaml . | nindent 4 }}
{{- end }}
metrics:
{{- with .Values.distributor.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
{{- if (eq $apiVersion "autoscaling/v2") }}
target:
type: Utilization
averageUtilization: {{ . }}
{{- else }}
targetAverageUtilization: {{ . }}
{{- end }}
{{- end }}
{{- with .Values.distributor.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
{{- if (eq $apiVersion "autoscaling/v2") }}
target:
type: Utilization
averageUtilization: {{ . }}
{{- else }}
targetAverageUtilization: {{ . }}
{{- end }}
{{- end }}
{{- end }}
@@ -0,0 +1,14 @@
{{- if gt (int .Values.distributor.replicas) 1 }}
{{ $dict := dict "ctx" . "component" "distributor" "memberlist" true }}
apiVersion: {{ include "tempo.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ include "tempo.resourceName" $dict }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "tempo.selectorLabels" $dict | nindent 6 }}
maxUnavailable: 1
{{- end }}
@@ -0,0 +1,86 @@
{{- $dict := dict "ctx" . "component" "distributor" }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "tempo.resourceName" $dict }}-discovery
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
{{- with .Values.distributor.serviceDiscovery.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
prometheus.io/service-monitor: "false"
{{- with .Values.distributor.serviceDiscovery.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: ClusterIP
clusterIP: None
ports:
- name: http-metrics
port: 3100
targetPort: http-metrics
{{- if .Values.traces.jaeger.thriftCompact.enabled }}
- name: distributor-jaeger-thrift-compact
port: 6831
protocol: UDP
targetPort: jaeger-compact
{{- end }}
{{- if .Values.traces.jaeger.thriftBinary.enabled }}
- name: distributor-jaeger-thrift-binary
port: 6832
protocol: UDP
targetPort: jaeger-binary
{{- end }}
{{- if .Values.traces.jaeger.thriftHttp.enabled }}
- name: distributor-jaeger-thrift-http
port: 14268
protocol: TCP
targetPort: jaeger-http
{{- end }}
{{- if .Values.traces.jaeger.grpc.enabled }}
- name: grpc-distributor-jaeger
port: 14250
protocol: TCP
targetPort: grpc-jaeger
{{- if .Values.distributor.appProtocol.grpc }}
appProtocol: {{ .Values.distributor.appProtocol.grpc }}
{{- end }}
{{- end }}
{{- if .Values.traces.zipkin.enabled }}
- name: distributor-zipkin
port: 9411
protocol: TCP
targetPort: zipkin
{{- end }}
{{- if .Values.traces.otlp.http.enabled }}
- name: distributor-otlp-http
port: 4318
protocol: TCP
targetPort: otlp-http
{{- end }}
{{- if .Values.traces.otlp.grpc.enabled }}
- name: grpc-distributor-otlp
port: 4317
protocol: TCP
targetPort: grpc-otlp
{{- if .Values.distributor.appProtocol.grpc }}
appProtocol: {{ .Values.distributor.appProtocol.grpc }}
{{- end }}
- name: distributor-otlp-legacy
port: 55680
protocol: TCP
targetPort: grpc-otlp
{{- if .Values.distributor.appProtocol.grpc }}
appProtocol: {{ .Values.distributor.appProtocol.grpc }}
{{- end }}
{{- end }}
{{- if .Values.traces.opencensus.enabled }}
- name: distributor-opencensus
port: 55678
protocol: TCP
targetPort: opencensus
{{- end }}
selector:
{{- include "tempo.selectorLabels" $dict | nindent 4 }}
@@ -0,0 +1,102 @@
{{- $dict := dict "ctx" . "component" "distributor" }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "tempo.resourceName" $dict }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
{{- with .Values.distributor.service.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.distributor.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.distributor.service.type }}
ports:
- name: http-metrics
port: 3100
targetPort: http-metrics
- name: grpc
port: 9095
protocol: TCP
targetPort: 9095
{{- if .Values.distributor.appProtocol.grpc }}
appProtocol: {{ .Values.distributor.appProtocol.grpc }}
{{- end }}
{{- if .Values.traces.jaeger.thriftCompact.enabled }}
- name: distributor-jaeger-thrift-compact
port: 6831
protocol: UDP
targetPort: jaeger-compact
{{- end }}
{{- if .Values.traces.jaeger.thriftBinary.enabled }}
- name: distributor-jaeger-thrift-binary
port: 6832
protocol: UDP
targetPort: jaeger-binary
{{- end }}
{{- if .Values.traces.jaeger.thriftHttp.enabled }}
- name: distributor-jaeger-thrift-http
port: 14268
protocol: TCP
targetPort: jaeger-http
{{- end }}
{{- if .Values.traces.jaeger.grpc.enabled }}
- name: grpc-distributor-jaeger
port: 14250
protocol: TCP
targetPort: grpc-jaeger
{{- if .Values.distributor.appProtocol.grpc }}
appProtocol: {{ .Values.distributor.appProtocol.grpc }}
{{- end }}
{{- end }}
{{- if .Values.traces.zipkin.enabled }}
- name: distributor-zipkin
port: 9411
protocol: TCP
targetPort: zipkin
{{- end }}
{{- if .Values.traces.otlp.http.enabled }}
- name: distributor-otlp-http
port: 4318
protocol: TCP
targetPort: otlp-http
{{- end }}
{{- if .Values.traces.otlp.grpc.enabled }}
- name: grpc-distributor-otlp
port: 4317
protocol: TCP
targetPort: grpc-otlp
{{- if .Values.distributor.appProtocol.grpc }}
appProtocol: {{ .Values.distributor.appProtocol.grpc }}
{{- end }}
- name: distributor-otlp-legacy
port: 55680
protocol: TCP
targetPort: grpc-otlp
{{- if .Values.distributor.appProtocol.grpc }}
appProtocol: {{ .Values.distributor.appProtocol.grpc }}
{{- end }}
{{- end }}
{{- if .Values.traces.opencensus.enabled }}
- name: distributor-opencensus
port: 55678
protocol: TCP
targetPort: opencensus
{{- end }}
{{- if .Values.distributor.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.distributor.service.loadBalancerIP }}
{{- end }}
{{- with .Values.distributor.service.externalTrafficPolicy }}
externalTrafficPolicy: {{ . }}
{{- end }}
{{- with .Values.distributor.service.loadBalancerSourceRanges}}
loadBalancerSourceRanges:
{{ toYaml . | nindent 4 }}
{{- end }}
selector:
{{- include "tempo.selectorLabels" $dict | nindent 4 }}
@@ -0,0 +1 @@
{{- include "tempo.lib.serviceMonitor" (dict "ctx" $ "component" "distributor" "memberlist" true) }}
@@ -0,0 +1,7 @@
{{/*
enterpriseFederationFrontend imagePullSecrets
*/}}
{{- define "tempo.enterpriseFederationFrontendImagePullSecrets" -}}
{{- $dict := dict "tempo" .Values.tempo.image "component" .Values.enterpriseFederationFrontend.image "global" .Values.global.image -}}
{{- include "tempo.imagePullSecrets" $dict -}}
{{- end }}
@@ -0,0 +1,132 @@
{{- if and .Values.enterprise.enabled .Values.enterpriseFederationFrontend.enabled }}
{{ $dict := dict "ctx" . "component" "enterprise-federation-frontend" }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "tempo.resourceName" $dict }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
{{- with .Values.enterpriseFederationFrontend.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
minReadySeconds: 10
{{- if not .Values.enterpriseFederationFrontend.autoscaling.enabled }}
replicas: {{ .Values.enterpriseFederationFrontend.replicas }}
{{- end }}
revisionHistoryLimit: 10
selector:
matchLabels:
{{- include "tempo.selectorLabels" $dict | nindent 6 }}
strategy:
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
template:
metadata:
labels:
{{- include "tempo.podLabels" $dict | nindent 8 }}
{{- with .Values.tempo.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.enterpriseFederationFrontend.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap-tempo.yaml") . | sha256sum }}
{{- with .Values.tempo.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.enterpriseFederationFrontend.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if or (.Values.enterpriseFederationFrontend.priorityClassName) (.Values.global.priorityClassName) }}
priorityClassName: {{ default .Values.enterpriseFederationFrontend.priorityClassName .Values.global.priorityClassName }}
{{- end }}
serviceAccountName: {{ include "tempo.serviceAccountName" . }}
{{- with .Values.tempo.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
enableServiceLinks: false
{{- include "tempo.enterpriseFederationFrontendImagePullSecrets" . | nindent 6 -}}
{{- with .Values.enterpriseFederationFrontend.hostAliases }}
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- args:
- -target=federation-frontend
- -config.file=/conf/tempo.yaml
- -mem-ballast-size-mbs=1024
{{- with .Values.enterpriseFederationFrontend.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
image: {{ include "tempo.imageReference" $dict }}
imagePullPolicy: {{ .Values.tempo.image.pullPolicy }}
name: federation-frontend
ports:
- containerPort: 3100
name: http-metrics
{{- with .Values.enterpriseFederationFrontend.extraEnv }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.enterpriseFederationFrontend.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.enterpriseFederationFrontend.resources | nindent 12 }}
{{- with .Values.tempo.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- mountPath: /conf
name: config
- mountPath: /var/tempo
name: tempo-federation-frontend-store
{{- if .Values.enterprise.enabled }}
- name: license
mountPath: /license
{{- end }}
{{- with .Values.enterpriseFederationFrontend.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.enterpriseFederationFrontend.terminationGracePeriodSeconds }}
{{- if ge (.Capabilities.KubeVersion.Minor|int) 19 }}
{{- with .Values.enterpriseFederationFrontend.topologySpreadConstraints }}
topologySpreadConstraints:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.enterpriseFederationFrontend.affinity }}
affinity:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- with .Values.enterpriseFederationFrontend.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.enterpriseFederationFrontend.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: config
{{- include "tempo.configVolume" . | nindent 10 }}
- name: tempo-federation-frontend-store
emptyDir: {}
{{- if .Values.enterprise.enabled }}
- name: license
secret:
secretName: {{ tpl .Values.license.secretName . }}
{{- end }}
{{- with .Values.enterpriseFederationFrontend.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
@@ -0,0 +1,41 @@
{{- if and .Values.enterprise.enabled .Values.enterpriseFederationFrontend.enabled .Values.enterpriseFederationFrontend.autoscaling.enabled }}
{{- $apiVersion := include "tempo.hpa.apiVersion" . -}}
apiVersion: {{ $apiVersion }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" . "component" "enterprise-federation-frontend") }}
labels:
{{- include "tempo.labels" (dict "ctx" . "component" "enterprise-federation-frontend") | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "tempo.resourceName" (dict "ctx" . "component" "enterprise-federation-frontend") }}
minReplicas: {{ .Values.enterpriseFederationFrontend.autoscaling.minReplicas }}
maxReplicas: {{ .Values.enterpriseFederationFrontend.autoscaling.maxReplicas }}
metrics:
{{- with .Values.enterpriseFederationFrontend.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
{{- if (eq $apiVersion "autoscaling/v2") }}
target:
type: Utilization
averageUtilization: {{ . }}
{{- else }}
targetAverageUtilization: {{ . }}
{{- end }}
{{- end }}
{{- with .Values.enterpriseFederationFrontend.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
{{- if (eq $apiVersion "autoscaling/v2") }}
target:
type: Utilization
averageUtilization: {{ . }}
{{- else }}
targetAverageUtilization: {{ . }}
{{- end }}
{{- end }}
{{- end }}
@@ -0,0 +1,16 @@
{{- if and .Values.enterprise.enabled .Values.enterpriseFederationFrontend.enabled -}}
{{- if gt (int .Values.enterpriseFederationFrontend.replicas) 1 }}
{{ $dict := dict "ctx" . "component" "enterprise-federation-frontend" }}
apiVersion: {{ include "tempo.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ include "tempo.resourceName" $dict }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "tempo.selectorLabels" $dict | nindent 6 }}
maxUnavailable: 1
{{- end }}
{{- end -}}
@@ -0,0 +1,28 @@
{{- if .Values.enterprise.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" . "component" "enterprise-federation-frontend") }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" (dict "ctx" . "component" "enterprise-federation-frontend") | nindent 4 }}
{{- with .Values.enterpriseFederationFrontend.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.enterpriseFederationFrontend.service.type }}
ports:
- name: http-metrics
port: 3100
targetPort: 3100
{{- if .Values.enterpriseFederationFrontend.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.enterpriseFederationFrontend.service.loadBalancerIP }}
{{- end }}
{{- with .Values.enterpriseFederationFrontend.service.loadBalancerSourceRanges}}
loadBalancerSourceRanges:
{{ toYaml . | nindent 4 }}
{{- end }}
selector:
{{- include "tempo.selectorLabels" (dict "ctx" . "component" "enterprise-federation-frontend") | nindent 4 }}
{{- end }}
@@ -0,0 +1,3 @@
{{- if and .Values.enterprise.enabled .Values.enterpriseFederationFrontend.enabled }}
{{- include "tempo.lib.serviceMonitor" (dict "ctx" $ "component" "enterprise-federation-frontend") }}
{{- end }}
@@ -0,0 +1,41 @@
{{/*
Return the appropriate apiVersion for ingress.
*/}}
{{- define "tempo.ingress.apiVersion" -}}
{{- if and (.Capabilities.APIVersions.Has "networking.k8s.io/v1") (semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version) -}}
{{- print "networking.k8s.io/v1" -}}
{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" -}}
{{- print "networking.k8s.io/v1beta1" -}}
{{- else -}}
{{- print "extensions/v1beta1" -}}
{{- end -}}
{{- end -}}
{{/*
Return if ingress is stable.
*/}}
{{- define "tempo.ingress.isStable" -}}
{{- eq (include "tempo.ingress.apiVersion" .) "networking.k8s.io/v1" -}}
{{- end -}}
{{/*
Return if ingress supports ingressClassName.
*/}}
{{- define "tempo.ingress.supportsIngressClassName" -}}
{{- or (eq (include "tempo.ingress.isStable" .) "true") (and (eq (include "tempo.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) -}}
{{- end -}}
{{/*
Return if ingress supports pathType.
*/}}
{{- define "tempo.ingress.supportsPathType" -}}
{{- or (eq (include "tempo.ingress.isStable" .) "true") (and (eq (include "tempo.ingress.apiVersion" .) "networking.k8s.io/v1beta1") (semverCompare ">= 1.18-0" .Capabilities.KubeVersion.Version)) -}}
{{- end -}}
{{/*
enterpriseGateway imagePullSecrets
*/}}
{{- define "tempo.enterpriseGatewayImagePullSecrets" -}}
{{- $dict := dict "tempo" .Values.tempo.image "component" .Values.enterpriseGateway.image "global" .Values.global.image -}}
{{- include "tempo.imagePullSecrets" $dict -}}
{{- end }}
@@ -0,0 +1,123 @@
{{- if .Values.enterprise.enabled -}}
{{ $dict := dict "ctx" . "component" "enterprise-gateway" }}
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
{{- toYaml .Values.enterpriseGateway.annotations | nindent 4 }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
name: {{ include "tempo.resourceName" $dict }}
namespace: {{ .Release.Namespace | quote }}
spec:
replicas: {{ .Values.enterpriseGateway.replicas }}
selector:
matchLabels:
{{- include "tempo.selectorLabels" $dict | nindent 6 }}
strategy:
{{- toYaml .Values.enterpriseGateway.strategy | nindent 4 }}
template:
metadata:
labels:
{{- include "tempo.podLabels" $dict | nindent 8 }}
{{- with .Values.enterpriseGateway.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
{{- include "tempo.podAnnotations" $dict | nindent 8 }}
namespace: {{ .Release.Namespace | quote }}
spec:
serviceAccountName: {{ template "tempo.serviceAccountName" . }}
{{- if .Values.enterpriseGateway.priorityClassName }}
priorityClassName: {{ .Values.enterpriseGateway.priorityClassName }}
{{- end }}
securityContext:
{{- toYaml .Values.enterpriseGateway.securityContext | nindent 8 }}
initContainers:
{{- toYaml .Values.enterpriseGateway.initContainers | nindent 8 }}
{{- include "tempo.enterpriseGatewayImagePullSecrets" . | nindent 6 -}}
{{- with .Values.enterpriseGateway.hostAliases }}
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: gateway
image: "{{ include "tempo.imageReference" $dict }}"
imagePullPolicy: {{ .Values.tempo.image.pullPolicy }}
args:
- "-target=gateway"
- "-config.expand-env=true"
- "-config.file=/conf/tempo.yaml"
{{- range $key, $value := .Values.enterpriseGateway.extraArgs }}
- "-{{ $key }}={{ $value }}"
{{- end }}
volumeMounts:
{{- if .Values.enterpriseGateway.extraVolumeMounts }}
{{ toYaml .Values.enterpriseGateway.extraVolumeMounts | nindent 12}}
{{- end }}
- name: config
mountPath: /conf
- name: license
mountPath: /license
- name: storage
mountPath: "/data"
subPath: {{ .Values.enterpriseGateway.persistence.subPath }}
ports:
- name: http-metrics
containerPort: {{ include "tempo.serverHttpListenPort" . }}
protocol: TCP
livenessProbe:
{{- toYaml .Values.enterpriseGateway.livenessProbe | nindent 12 }}
readinessProbe:
{{- toYaml .Values.enterpriseGateway.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.enterpriseGateway.resources | nindent 12 }}
securityContext:
{{- toYaml .Values.enterpriseGateway.containerSecurityContext | nindent 12 }}
env:
{{- with .Values.global.extraEnv }}
{{ toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.enterpriseGateway.env }}
{{ toYaml . | nindent 12 }}
{{- end }}
envFrom:
{{- with .Values.global.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.enterpriseGateway.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.enterpriseGateway.extraContainers }}
{{ toYaml . | nindent 8 }}
{{- end }}
nodeSelector:
{{- toYaml .Values.enterpriseGateway.nodeSelector | nindent 8 }}
{{- if semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.enterpriseGateway.topologySpreadConstraints }}
topologySpreadConstraints:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.enterpriseGateway.affinity }}
affinity:
{{- tpl . $ | nindent 8 }}
{{- end }}
tolerations:
{{- toYaml .Values.enterpriseGateway.tolerations | nindent 8 }}
terminationGracePeriodSeconds: {{ .Values.enterpriseGateway.terminationGracePeriodSeconds }}
volumes:
- name: config
{{- include "tempo.configVolume" . | nindent 10 }}
- name: runtime-config
configMap:
name: {{ template "tempo.fullname" . }}-runtime
{{- if .Values.enterpriseGateway.extraVolumes }}
{{ toYaml .Values.enterpriseGateway.extraVolumes | nindent 8}}
{{- end }}
- name: license
secret:
secretName: {{ tpl .Values.license.secretName . }}
- name: storage
emptyDir: {}
{{- end -}}
@@ -0,0 +1,57 @@
{{- if .Values.enterprise.enabled -}}
{{ $dict := dict "ctx" . "component" "enterprise-gateway" }}
{{- if .Values.enterpriseGateway.ingress.enabled -}}
{{- $ingressApiIsStable := eq (include "tempo.ingress.isStable" .) "true" -}}
{{- $ingressSupportsIngressClassName := eq (include "tempo.ingress.supportsIngressClassName" .) "true" -}}
{{- $ingressSupportsPathType := eq (include "tempo.ingress.supportsPathType" .) "true" -}}
apiVersion: {{ include "tempo.ingress.apiVersion" . }}
kind: Ingress
metadata:
name: {{ include "tempo.resourceName" $dict }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
{{- with .Values.enterpriseGateway.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
namespace: {{ .Release.Namespace | quote }}
spec:
{{- if and $ingressSupportsIngressClassName .Values.enterpriseGateway.ingress.ingressClassName }}
ingressClassName: {{ .Values.enterpriseGateway.ingress.ingressClassName }}
{{- end -}}
{{- if .Values.enterpriseGateway.ingress.tls }}
tls:
{{- range .Values.enterpriseGateway.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
{{- with .secretName }}
secretName: {{ . }}
{{- end }}
{{- end }}
{{- end }}
rules:
{{- range .Values.enterpriseGateway.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if $ingressSupportsPathType }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if $ingressApiIsStable }}
service:
name: {{ include "tempo.resourceName" $dict }}
port:
number: {{ $.Values.enterpriseGateway.service.port | default (include "tempo.serverHttpListenPort" $ ) }}
{{- else }}
serviceName: {{ include "tempo.resourceName" $dict }}
servicePort: {{ $.Values.enterpriseGateway.service.port | default (include "tempo.serverHttpListenPort" $ ) }}
{{- end }}
{{- end }}
{{- end }}
{{- end -}}
{{- end -}}
@@ -0,0 +1,3 @@
{{- if .Values.enterprise.enabled -}}
{{- include "tempo.lib.podDisruptionBudget" (dict "ctx" $ "component" "enterprise-gateway") }}
{{- end -}}
@@ -0,0 +1,3 @@
{{- if .Values.enterprise.enabled -}}
{{- include "tempo.lib.serviceMonitor" (dict "ctx" $ "component" "enterprise-gateway") }}
{{- end -}}
@@ -0,0 +1,30 @@
{{- if .Values.enterprise.enabled -}}
{{ $dict := dict "ctx" . "component" "enterprise-gateway" }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "tempo.resourceName" $dict }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
{{- with .Values.enterpriseGateway.service.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
annotations:
{{- toYaml .Values.enterpriseGateway.service.annotations | nindent 4 }}
namespace: {{ .Release.Namespace | quote }}
spec:
type: {{ .Values.enterpriseGateway.service.type }}
{{- with .Values.enterpriseGateway.service.clusterIP }}
clusterIP: {{ . }}
{{- end }}
{{- if and (eq "LoadBalancer" .Values.enterpriseGateway.service.type) .Values.enterpriseGateway.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.enterpriseGateway.service.loadBalancerIP }}
{{- end }}
ports:
- port: {{ .Values.enterpriseGateway.service.port | default (include "tempo.serverHttpListenPort" . ) }}
protocol: TCP
name: http-metrics
targetPort: http-metrics
selector:
{{- include "tempo.selectorLabels" $dict | nindent 4 }}
{{- end -}}
@@ -0,0 +1,4 @@
{{ range .Values.extraObjects }}
---
{{ tpl (toYaml .) $ }}
{{ end }}
@@ -0,0 +1,23 @@
{{/*
gateway auth secret name
*/}}
{{- define "tempo.gatewayAuthSecret" -}}
{{ .Values.gateway.basicAuth.existingSecret | default (include "tempo.resourceName" (dict "ctx" . "component" "gateway")) }}
{{- end }}
{{/*
gateway image
*/}}
{{- define "tempo.gatewayImage" -}}
{{- $dict := dict "tempo" (dict) "service" .Values.gateway.image "global" .Values.global.image -}}
{{- include "tempo.tempoImage" $dict -}}
{{- end }}
{{/*
gateway imagePullSecrets
*/}}
{{- define "tempo.gatewayImagePullSecrets" -}}
{{- $dict := dict "component" .Values.gateway.image "global" .Values.global.image "tempo" (dict) -}}
{{- include "tempo.imagePullSecrets" $dict -}}
{{- end }}
@@ -0,0 +1,12 @@
{{- if .Values.gateway.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" . "component" "gateway") }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" (dict "ctx" . "component" "gateway") | nindent 4 }}
data:
nginx.conf: |
{{- tpl .Values.gateway.nginxConfig.file . | nindent 4 }}
{{- end }}
@@ -0,0 +1,134 @@
{{- if .Values.gateway.enabled }}
{{ $dict := dict "ctx" . "component" "gateway" }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "tempo.resourceName" $dict }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
spec:
minReadySeconds: 10
{{- if not .Values.gateway.autoscaling.enabled }}
replicas: {{ .Values.gateway.replicas }}
{{- end }}
revisionHistoryLimit: 10
selector:
matchLabels:
{{- include "tempo.selectorLabels" $dict | nindent 6 }}
template:
metadata:
annotations:
checksum/config: {{ include (print .Template.BasePath "/gateway/configmap-gateway.yaml") . | sha256sum }}
{{- with .Values.tempo.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.gateway.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "tempo.selectorLabels" $dict | nindent 8 }}
{{- with .Values.tempo.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.gateway.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if or (.Values.gateway.priorityClassName) (.Values.global.priorityClassName) }}
priorityClassName: {{ default .Values.gateway.priorityClassName .Values.global.priorityClassName }}
{{- end }}
serviceAccountName: {{ include "tempo.serviceAccountName" . }}
{{- with .Values.tempo.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.gateway.terminationGracePeriodSeconds }}
enableServiceLinks: false
{{- include "tempo.gatewayImagePullSecrets" . | nindent 6 -}}
{{- with .Values.gateway.hostAliases }}
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: nginx
image: "{{ include "tempo.imageReference" $dict }}"
imagePullPolicy: {{ .Values.gateway.image.pullPolicy }}
ports:
- name: http-metrics
containerPort: 8080
protocol: TCP
{{- with .Values.gateway.extraEnv }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.gateway.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
readinessProbe:
{{- toYaml .Values.gateway.readinessProbe | nindent 12 }}
volumeMounts:
- name: config
mountPath: /etc/nginx
{{- if .Values.enterprise.enabled }}
- name: license
mountPath: /license
{{- end }}
{{- if .Values.gateway.basicAuth.enabled }}
- name: auth
mountPath: /etc/nginx/secrets
{{- end }}
- name: tmp
mountPath: /tmp
- name: docker-entrypoint-d-override
mountPath: /docker-entrypoint.d
{{- if .Values.gateway.extraVolumeMounts }}
{{- toYaml .Values.gateway.extraVolumeMounts | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.gateway.resources | nindent 12 }}
{{- with .Values.tempo.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.gateway.topologySpreadConstraints }}
topologySpreadConstraints:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.gateway.affinity }}
affinity:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- with .Values.gateway.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.gateway.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: config
configMap:
name: {{ include "tempo.resourceName" (dict "ctx" . "component" "gateway") }}
{{- if .Values.enterprise.enabled -}}
- name: license
secret:
secretName: {{ tpl .Values.license.secretName . }}
{{- end }}
{{- if .Values.gateway.basicAuth.enabled }}
- name: auth
secret:
secretName: {{ include "tempo.gatewayAuthSecret" . }}
{{- end }}
- name: tmp
emptyDir: {}
- name: docker-entrypoint-d-override
emptyDir: {}
{{- if .Values.gateway.extraVolumes }}
{{- toYaml .Values.gateway.extraVolumes | nindent 8 }}
{{- end }}
{{- end }}
@@ -0,0 +1,46 @@
{{- if .Values.gateway.autoscaling.enabled }}
{{- $apiVersion := include "tempo.hpa.apiVersion" . -}}
apiVersion: {{ $apiVersion }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" . "component" "gateway") }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" (dict "ctx" . "component" "gateway") | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "tempo.resourceName" (dict "ctx" . "component" "gateway") }}
minReplicas: {{ .Values.gateway.autoscaling.minReplicas }}
maxReplicas: {{ .Values.gateway.autoscaling.maxReplicas }}
{{- with .Values.gateway.autoscaling.behavior }}
behavior:
{{- toYaml . | nindent 4 }}
{{- end }}
metrics:
{{- with .Values.gateway.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
{{- if (eq $apiVersion "autoscaling/v2") }}
target:
type: Utilization
averageUtilization: {{ . }}
{{- else }}
targetAverageUtilization: {{ . }}
{{- end }}
{{- end }}
{{- with .Values.gateway.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
{{- if (eq $apiVersion "autoscaling/v2") }}
target:
type: Utilization
averageUtilization: {{ . }}
{{- else }}
targetAverageUtilization: {{ . }}
{{- end }}
{{- end }}
{{- end }}
@@ -0,0 +1,60 @@
{{- if .Values.gateway.enabled -}}
{{- if .Values.gateway.ingress.enabled -}}
{{ $dict := dict "ctx" . "component" "gateway" }}
{{- $ingressApiIsStable := eq (include "tempo.ingress.isStable" .) "true" -}}
{{- $ingressSupportsIngressClassName := eq (include "tempo.ingress.supportsIngressClassName" .) "true" -}}
{{- $ingressSupportsPathType := eq (include "tempo.ingress.supportsPathType" .) "true" -}}
apiVersion: {{ include "tempo.ingress.apiVersion" . }}
kind: Ingress
metadata:
name: {{ include "tempo.resourceName" $dict }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" (dict "ctx" . "component" "gateway") | nindent 4 }}
{{- with .Values.gateway.ingress.labels }}
{{- toYaml . | nindent 4}}
{{- end}}
{{- with .Values.gateway.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and $ingressSupportsIngressClassName .Values.gateway.ingress.ingressClassName }}
ingressClassName: {{ .Values.gateway.ingress.ingressClassName }}
{{- end -}}
{{- if .Values.gateway.ingress.tls }}
tls:
{{- range .Values.gateway.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
{{- with .secretName }}
secretName: {{ . }}
{{- end }}
{{- end }}
{{- end }}
rules:
{{- range .Values.gateway.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if $ingressSupportsPathType }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if $ingressApiIsStable }}
service:
name: {{ include "tempo.resourceName" $dict }}
port:
number: {{ $.Values.gateway.service.port }}
{{- else }}
serviceName: {{ include "tempo.resourceName" $dict }}
servicePort: {{ $.Values.gateway.service.port }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
@@ -0,0 +1,15 @@
{{- if gt (int .Values.gateway.replicas) 1 }}
{{ $dict := dict "ctx" . "component" "gateway" }}
apiVersion: {{ include "tempo.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ include "tempo.resourceName" $dict }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "tempo.selectorLabels" $dict | nindent 6 }}
maxUnavailable: 1
{{- end }}
@@ -0,0 +1,16 @@
{{- $root := . -}}
{{- $dict := dict "ctx" . "component" "gateway" -}}
{{- with .Values.gateway }}
{{- if and .enabled .basicAuth.enabled (not .basicAuth.existingSecret) }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "tempo.resourceName" $dict }}
namespace: {{ $root.Release.Namespace | quote }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
stringData:
.htpasswd: |
{{- tpl .basicAuth.htpasswd $dict.ctx | nindent 4 }}
{{- end }}
{{- end }}
@@ -0,0 +1,40 @@
{{- if .Values.gateway.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" . "component" "gateway") }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" (dict "ctx" . "component" "gateway") | nindent 4 }}
{{- with .Values.gateway.service.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.gateway.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.gateway.service.type }}
{{- with .Values.gateway.service.clusterIP }}
clusterIP: {{ . }}
{{- end }}
{{- if and (eq "LoadBalancer" .Values.gateway.service.type) .Values.gateway.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.gateway.service.loadBalancerIP }}
{{- end }}
ports:
- name: http-metrics
port: {{ .Values.gateway.service.port }}
targetPort: http-metrics
{{- if and (eq "NodePort" .Values.gateway.service.type) .Values.gateway.service.nodePort }}
nodePort: {{ .Values.gateway.service.nodePort }}
{{- end }}
protocol: TCP
{{ range .Values.gateway.service.additionalPorts }}
- name: {{ .name }}
port: {{ .port }}
targetPort: {{ .targetPort }}
protocol: {{ .protocol }}
{{ end }}
selector:
{{- include "tempo.selectorLabels" (dict "ctx" . "component" "gateway") | nindent 4 }}
{{- end }}
@@ -0,0 +1,8 @@
{{/*
gossip-ring selector labels
*/}}
{{- define "tempo.gossipRingSelectorLabels" -}}
{{ include "tempo.selectorLabels" . }}
app.kubernetes.io/part-of: memberlist
{{- end -}}
@@ -0,0 +1,21 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" . "component" "gossip-ring") }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" (dict "ctx" . "component" "gossip-ring") | nindent 4 }}
spec:
type: ClusterIP
clusterIP: None
ports:
- name: gossip-ring
port: {{ include "tempo.memberlistBindPort" . }}
protocol: TCP
targetPort: {{ include "tempo.memberlistBindPort" . }}
{{- if .Values.tempo.memberlist.appProtocol }}
appProtocol: {{ .Values.tempo.memberlist.appProtocol }}
{{- end }}
publishNotReadyAddresses: true
selector:
{{- include "tempo.gossipRingSelectorLabels" (dict "ctx" .) | nindent 4 }}
@@ -0,0 +1,182 @@
{{- define "tempo.ingesterImagePullSecrets" -}}
{{- $dict := dict "tempo" .Values.tempo.image "component" .Values.ingester.image "global" .Values.global.image -}}
{{- include "tempo.imagePullSecrets" $dict -}}
{{- end }}
{{- define "ingester.zoneAwareReplicationMap" -}}
{{- $zonesMap := (dict) -}}
{{- $defaultZone := (dict "affinity" .ctx.Values.ingester.affinity "nodeSelector" .ctx.Values.ingester.nodeSelector "replicas" .ctx.Values.ingester.replicas "storageClass" .ctx.Values.ingester.storageClass) -}}
{{- if .ctx.Values.ingester.zoneAwareReplication.enabled -}}
{{- $numberOfZones := len .ctx.Values.ingester.zoneAwareReplication.zones -}}
{{- if lt $numberOfZones 3 -}}
{{- fail "When zone-awareness is enabled, you must have at least 3 zones defined." -}}
{{- end -}}
{{- $requestedReplicas := .ctx.Values.ingester.replicas -}}
{{- $replicaPerZone := div (add $requestedReplicas $numberOfZones -1) $numberOfZones -}}
{{- range $idx, $rolloutZone := .ctx.Values.ingester.zoneAwareReplication.zones -}}
{{- $_ := set $zonesMap $rolloutZone.name (dict
"affinity" (($rolloutZone.extraAffinity | default (dict)) | mergeOverwrite (include "ingester.zoneAntiAffinity" (dict "rolloutZoneName" $rolloutZone.name "topologyKey" $.ctx.Values.ingester.zoneAwareReplication.topologyKey) | fromYaml))
"nodeSelector" ($rolloutZone.nodeSelector | default (dict) )
"replicas" $replicaPerZone
"storageClass" $rolloutZone.storageClass
) -}}
{{- end -}}
{{- else -}}
{{- $_ := set $zonesMap "" $defaultZone -}}
{{- end -}}
{{- $zonesMap | toYaml }}
{{- end -}}
{{/*
Calculate anti-affinity for a zone
Params:
rolloutZoneName = name of the rollout zone
topologyKey = topology key
*/}}
{{- define "ingester.zoneAntiAffinity" -}}
{{- if .topologyKey -}}
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: rollout-group
operator: In
values:
- ingester
- key: zone
operator: NotIn
values:
- {{ .rolloutZoneName }}
topologyKey: {{ .topologyKey | quote }}
{{- else -}}
{}
{{- end -}}
{{- end -}}
{{/*
Calculate annotations with zone-awareness
Params:
ctx = . context
component = component name
rolloutZoneName = rollout zone name (optional)
*/}}
{{- define "ingester.Annotations" -}}
{{- if and .ctx.Values.ingester.zoneAwareReplication.maxUnavailable .rolloutZoneName }}
{{- $map := dict "rollout-max-unavailable" (.ctx.Values.ingester.zoneAwareReplication.maxUnavailable | toString) -}}
{{- toYaml (deepCopy $map | mergeOverwrite .ctx.Values.ingester.annotations) }}
{{- else -}}
{{ toYaml .ctx.Values.ingester.annotations }}
{{- end -}}
{{- end -}}
{{/*
ingester labels
*/}}
{{- define "ingester.labels" -}}
{{- if and .ctx.Values.ingester.zoneAwareReplication.enabled .rolloutZoneName }}
name: {{ printf "%s-%s" .component .rolloutZoneName }}
rollout-group: {{ .component }}
zone: {{ .rolloutZoneName }}
{{- end }}
helm.sh/chart: {{ include "tempo.chart" .ctx }}
app.kubernetes.io/name: {{ include "tempo.name" .ctx }}
app.kubernetes.io/instance: {{ .ctx.Release.Name }}
{{- if .component }}
app.kubernetes.io/component: {{ .component }}
{{- end }}
{{- if .memberlist }}
app.kubernetes.io/part-of: memberlist
{{- end }}
{{- if .ctx.Chart.AppVersion }}
app.kubernetes.io/version: {{ .ctx.Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .ctx.Release.Service }}
{{- end -}}
{{/*
Resource name template
*/}}
{{- define "ingester.resourceName" -}}
{{- $resourceName := include "tempo.fullname" .ctx -}}
{{- if .component -}}{{- $resourceName = printf "%s-%s" $resourceName .component -}}{{- end -}}
{{- if .rolloutZoneName -}}{{- $resourceName = printf "%s-%s" $resourceName .rolloutZoneName -}}{{- end -}}
{{- $resourceName -}}
{{- end -}}
{{/*
ingester selector labels
Params:
ctx = . context
component = name of the component
rolloutZoneName = rollout zone name (optional)
*/}}
{{- define "ingester.selectorLabels" -}}
{{- if .ctx.Values.enterprise.legacyLabels }}
{{- if .component -}}
app: {{ include "tempo.name" .ctx }}-{{ .component }}
{{- end }}
release: {{ .ctx.Release.Name }}
{{- else -}}
app.kubernetes.io/name: {{ include "tempo.name" .ctx }}
app.kubernetes.io/instance: {{ .ctx.Release.Name }}
{{- if .component }}
app.kubernetes.io/component: {{ .component }}
{{- end }}
{{- end -}}
{{- if .rolloutZoneName }}
{{- if not .component }}
{{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .rolloutZoneName | fail }}
{{- end }}
rollout-group: {{ .component }}
zone: {{ .rolloutZoneName }}
{{- end }}
{{- end -}}
{{/*
ingester POD labels
Params:
ctx = . context
component = name of the component
memberlist = true if part of memberlist gossip ring
rolloutZoneName = rollout zone name (optional)
*/}}
{{- define "ingester.podLabels" -}}
{{ with .ctx.Values.global.podLabels -}}
{{ toYaml . }}
{{ end }}
{{- if .ctx.Values.enterprise.legacyLabels }}
{{- if .component -}}
app: {{ include "tempo.name" .ctx }}-{{ .component }}
{{- if not .rolloutZoneName }}
name: {{ .component }}
{{- end }}
{{- end }}
{{- if .memberlist }}
gossip_ring_member: "true"
{{- end -}}
{{- if .component }}
target: {{ .component }}
release: {{ .ctx.Release.Name }}
{{- end }}
{{- else -}}
helm.sh/chart: {{ include "tempo.chart" .ctx }}
app.kubernetes.io/name: {{ include "tempo.name" .ctx }}
app.kubernetes.io/instance: {{ .ctx.Release.Name }}
app.kubernetes.io/version: {{ .ctx.Chart.AppVersion | quote }}
app.kubernetes.io/managed-by: {{ .ctx.Release.Service }}
{{- if .component }}
app.kubernetes.io/component: {{ .component }}
{{- end }}
{{- if .memberlist }}
app.kubernetes.io/part-of: memberlist
{{- end }}
{{- end }}
{{- with .ctx.Values.ingester.podLabels }}
{{ toYaml . }}
{{- end }}
{{- if .rolloutZoneName }}
{{- if not .component }}
{{- printf "Component name cannot be empty if rolloutZoneName (%s) is set" .rolloutZoneName | fail }}
{{- end }}
rollout-group: ingester
zone: {{ .rolloutZoneName }}
{{- end }}
{{- end -}}
@@ -0,0 +1,45 @@
{{- if .Values.ingester.autoscaling.enabled }}
{{- $apiVersion := include "tempo.hpa.apiVersion" . -}}
apiVersion: {{ $apiVersion }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" . "component" "ingester") }}
labels:
{{- include "tempo.labels" (dict "ctx" . "component" "ingester") | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: StatefulSet
name: {{ include "tempo.resourceName" (dict "ctx" . "component" "ingester") }}
minReplicas: {{ .Values.ingester.autoscaling.minReplicas }}
maxReplicas: {{ .Values.ingester.autoscaling.maxReplicas }}
{{- with .Values.ingester.autoscaling.behavior }}
behavior:
{{- toYaml . | nindent 4 }}
{{- end }}
metrics:
{{- with .Values.ingester.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
{{- if (eq $apiVersion "autoscaling/v2") }}
target:
type: Utilization
averageUtilization: {{ . }}
{{- else }}
targetAverageUtilization: {{ . }}
{{- end }}
{{- end }}
{{- with .Values.ingester.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
{{- if (eq $apiVersion "autoscaling/v2") }}
target:
type: Utilization
averageUtilization: {{ . }}
{{- else }}
targetAverageUtilization: {{ . }}
{{- end }}
{{- end }}
{{- end }}
@@ -0,0 +1,14 @@
{{- if .Values.podDisruptionBudget -}}
apiVersion: {{ include "tempo.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" . "component" "ingester") }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" (dict "ctx" . "component" "ingester") | nindent 4 }}
spec:
selector:
matchLabels:
app: {{ include "tempo.resourceName" (dict "ctx" . "component" "ingester") }}
{{ toYaml .Values.podDisruptionBudget | indent 2 }}
{{- end }}
@@ -0,0 +1,14 @@
{{- if gt (int .Values.ingester.replicas) 1 }}
{{ $dict := dict "ctx" . "component" "ingester" "memberlist" true }}
apiVersion: {{ include "tempo.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ include "tempo.resourceName" $dict }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "tempo.selectorLabels" $dict | nindent 6 }}
maxUnavailable: {{ sub (.Values.ingester.replicas) (add (div .Values.ingester.config.replication_factor 2) 1) }}
{{- end }}
@@ -0,0 +1,30 @@
{{- $dict := dict "ctx" . "component" "ingester" true }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "tempo.resourceName" $dict }}-discovery
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
prometheus.io/service-monitor: "false"
{{- with .Values.ingester.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: ClusterIP
clusterIP: None
ports:
- name: http-metrics
port: 3100
protocol: TCP
targetPort: 3100
- name: grpc
port: 9095
protocol: TCP
targetPort: 9095
{{- if .Values.ingester.appProtocol.grpc }}
appProtocol: {{ .Values.ingester.appProtocol.grpc }}
{{- end }}
selector:
{{- include "tempo.selectorLabels" $dict | nindent 4 }}
@@ -0,0 +1,27 @@
{{- $dict := dict "ctx" . "component" "ingester" true }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "tempo.resourceName" $dict }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
{{- with .Values.ingester.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ports:
- name: http-metrics
port: 3100
protocol: TCP
targetPort: 3100
- name: grpc
port: 9095
protocol: TCP
targetPort: 9095
{{- if .Values.ingester.appProtocol.grpc }}
appProtocol: {{ .Values.ingester.appProtocol.grpc }}
{{- end }}
selector:
{{- include "tempo.selectorLabels" $dict | nindent 4 }}
@@ -0,0 +1 @@
{{- include "tempo.lib.serviceMonitor" (dict "ctx" $ "component" "ingester" "memberlist" true) }}
@@ -0,0 +1,195 @@
{{- $dict := dict "ctx" . "component" "ingester" "memberlist" true -}}
{{- $zonesMap := include "ingester.zoneAwareReplicationMap" $dict | fromYaml -}}
{{- range $zoneName, $rolloutZone := $zonesMap -}}
{{- with $ -}}
{{- $_ := set $dict "rolloutZoneName" $zoneName -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ template "ingester.resourceName" $dict }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "ingester.labels" $dict | indent 4 }}
{{- if .Values.ingester.zoneAwareReplication.enabled }}
annotations:
{{- include "ingester.Annotations" $dict | nindent 4}}
{{- else }}
{{- with .Values.ingester.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
spec:
{{- if not .Values.ingester.autoscaling.enabled }}
replicas: {{ $rolloutZone.replicas }}
{{- end }}
selector:
matchLabels:
{{- include "ingester.selectorLabels" $dict | nindent 6}}
serviceName: ingester
podManagementPolicy: Parallel
updateStrategy:
{{- if .Values.ingester.zoneAwareReplication.enabled }}
type: OnDelete
{{- else }}
rollingUpdate:
partition: 0
{{- end }}
template:
metadata:
labels:
{{- include "ingester.podLabels" $dict | nindent 8 }}
{{- with .Values.tempo.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.ingester.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap-tempo.yaml") . | sha256sum }}
{{- with .Values.tempo.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.ingester.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if or (.Values.ingester.priorityClassName) (.Values.global.priorityClassName) }}
priorityClassName: {{ default .Values.ingester.priorityClassName .Values.global.priorityClassName }}
{{- end }}
serviceAccountName: {{ include "tempo.serviceAccountName" . }}
{{- with .Values.tempo.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
enableServiceLinks: false
{{- include "tempo.ingesterImagePullSecrets" . | nindent 6 -}}
{{- with .Values.ingester.hostAliases }}
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
initContainers:
{{- toYaml .Values.ingester.initContainers | nindent 8 }}
containers:
- args:
- -target=ingester
- -config.file=/conf/tempo.yaml
- -mem-ballast-size-mbs=1024
{{- with .Values.ingester.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
image: {{ include "tempo.imageReference" $dict }}
imagePullPolicy: {{ .Values.tempo.image.pullPolicy }}
name: ingester
ports:
- name: grpc
containerPort: 9095
- name: http-memberlist
containerPort: {{ include "tempo.memberlistBindPort" . }}
- name: http-metrics
containerPort: 3100
{{- with .Values.ingester.extraEnv }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.ingester.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
readinessProbe:
{{- toYaml .Values.tempo.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.ingester.resources | nindent 12 }}
{{- with .Values.tempo.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- mountPath: /conf
name: config
- mountPath: /runtime-config
name: runtime-config
- mountPath: /var/tempo
name: data
{{- if .Values.enterprise.enabled }}
- name: license
mountPath: /license
{{- end }}
{{- with .Values.ingester.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.ingester.terminationGracePeriodSeconds }}
{{- if semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.ingester.topologySpreadConstraints }}
topologySpreadConstraints:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- end }}
{{- if eq $zoneName ""}}
{{- with $rolloutZone.affinity }}
affinity:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- end }}
{{- if ne $zoneName "" }}
{{- with $rolloutZone.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- with $rolloutZone.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.ingester.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: config
{{- include "tempo.configVolume" . | nindent 10 }}
- name: runtime-config
{{- include "tempo.runtimeVolume" . | nindent 10 }}
{{- if .Values.enterprise.enabled }}
- name: license
secret:
secretName: {{ tpl .Values.license.secretName . }}
{{- end }}
{{- with .Values.ingester.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if not .Values.ingester.persistence.enabled }}
- name: data
emptyDir: {}
{{- else if .Values.ingester.persistence.inMemory }}
- name: data
{{- if .Values.ingester.persistence.inMemory }}
emptyDir:
medium: Memory
{{- end }}
{{- if .Values.ingester.persistence.size }}
sizeLimit: {{ .Values.ingester.persistence.size }}
{{- end }}
{{- else }}
volumeClaimTemplates:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
{{- with .Values.ingester.persistence.annotations }}
annotations:
{{- toYaml . | nindent 10 }}
{{- end }}
name: data
spec:
accessModes:
- ReadWriteOnce
{{- with .Values.ingester.persistence.storageClass }}
storageClassName: {{ if (eq "-" .) }}""{{ else }}{{ . }}{{ end }}
{{- end }}
resources:
requests:
storage: {{ .Values.ingester.persistence.size | quote }}
{{- end }}
---
{{ end }}
{{ end }}
@@ -0,0 +1,25 @@
{{/*
Tempo common PodDisruptionBudget definition
Params:
ctx = . context
component = name of the component
*/}}
{{- define "tempo.lib.podDisruptionBudget" -}}
{{- $componentSection := include "tempo.componentSectionFromName" . }}
{{ with (index $.ctx.Values $componentSection) }}
{{- if .podDisruptionBudget -}}
apiVersion: {{ include "tempo.podDisruptionBudget.apiVersion" $.ctx }}
kind: PodDisruptionBudget
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" $.ctx "component" $.component) }}
labels:
{{- include "tempo.labels" (dict "ctx" $.ctx "component" $.component) | nindent 4 }}
namespace: {{ $.ctx.Release.Namespace | quote }}
spec:
selector:
matchLabels:
{{- include "tempo.selectorLabels" (dict "ctx" $.ctx "component" $.component) | nindent 6 }}
{{ toYaml .podDisruptionBudget | indent 2 }}
{{- end -}}
{{- end -}}
{{- end -}}
@@ -0,0 +1,74 @@
{{/*
Tempo common ServiceMonitor definition
Params:
ctx = . context
component = name of the component
memberlist = true/false, whether component is part of memberlist
*/}}
{{- define "tempo.lib.serviceMonitor" -}}
{{- with .ctx.Values.metaMonitoring.serviceMonitor }}
{{- if .enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "tempo.resourceName" $ }}
namespace: {{ .namespace | default $.ctx.Release.Namespace | quote }}
labels:
{{- include "tempo.labels" $ | nindent 4 }}
{{- with .labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
namespaceSelector:
{{- if .namespaceSelector }}
{{- toYaml .namespaceSelector | nindent 4 }}
{{- else }}
matchNames:
- {{ $.ctx.Release.Namespace }}
{{- end }}
selector:
matchLabels:
{{- include "tempo.selectorLabels" $ | nindent 6 }}
matchExpressions:
- key: prometheus.io/service-monitor
operator: NotIn
values:
- "false"
endpoints:
- port: http-metrics
{{- with .interval }}
interval: {{ . }}
{{- end }}
{{- with .scrapeTimeout }}
scrapeTimeout: {{ . }}
{{- end }}
relabelings:
- action: replace
sourceLabels: [job]
replacement: "{{ $.ctx.Release.Namespace }}/{{ $.component }}"
targetLabel: job
{{- if kindIs "string" .clusterLabel }}
- replacement: "{{ .clusterLabel | default (include "tempo.clusterName" $.ctx) }}"
targetLabel: cluster
{{- end }}
{{- with .relabelings }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .metricRelabelings }}
metricRelabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .scheme }}
scheme: {{ . }}
{{- end }}
{{- with .tlsConfig }}
tlsConfig:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end -}}
{{- end -}}
{{- end -}}
@@ -0,0 +1,14 @@
{{- if .Values.enterprise.enabled -}}
{{- if not .Values.license.external }}
apiVersion: v1
kind: Secret
metadata:
name: {{ tpl .Values.license.secretName . }}
labels:
{{- include "tempo.labels" (dict "ctx" .) | nindent 4 }}
namespace: {{ .Release.Namespace | quote }}
data:
license.jwt: {{ .Values.license.contents | b64enc }}
{{- end -}}
{{- end -}}
@@ -0,0 +1,7 @@
{{/*
memcachedExporter imagePullSecrets
*/}}
{{- define "tempo.memcachedExporterImagePullSecrets" -}}
{{- $dict := dict "component" .Values.memcachedExporter.image "global" .Values.global.image "tempo" (dict) -}}
{{- include "tempo.imagePullSecrets" $dict -}}
{{- end }}
@@ -0,0 +1,14 @@
{{- if gt (int .Values.memcached.replicas) 1 }}
{{ $dict := dict "ctx" . "component" "memcached" }}
apiVersion: {{ include "tempo.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ include "tempo.resourceName" $dict }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "tempo.selectorLabels" $dict | nindent 6 }}
maxUnavailable: 1
{{- end }}
@@ -0,0 +1,23 @@
{{- if .Values.memcached.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" . "component" "memcached") }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" (dict "ctx" . "component" "memcached") | nindent 4 }}
{{- with .Values.memcached.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ports:
- name: memcached-client
port: 11211
targetPort: 11211
- name: http-metrics
port: 9150
targetPort: http-metrics
selector:
{{- include "tempo.selectorLabels" (dict "ctx" . "component" "memcached") | nindent 4 }}
{{- end}}
@@ -0,0 +1 @@
{{- include "tempo.lib.serviceMonitor" (dict "ctx" $ "component" "memcached") }}
@@ -0,0 +1,118 @@
{{- if .Values.memcached.enabled }}
{{ $dict := dict "ctx" . "component" "memcached" }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "tempo.resourceName" $dict }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
{{- with .Values.memcached.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.memcached.replicas }}
selector:
matchLabels:
{{- include "tempo.selectorLabels" $dict | nindent 6 }}
serviceName: memcached
template:
metadata:
{{- if or .Values.tempo.podAnnotations .Values.memcached.podAnnotations }}
annotations:
{{- with .Values.tempo.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.memcached.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
labels:
{{- include "tempo.labels" $dict | nindent 8 }}
{{- with .Values.tempo.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.memcached.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if or (.Values.memcached.priorityClassName) (.Values.global.priorityClassName) }}
priorityClassName: {{ default .Values.memcached.priorityClassName .Values.global.priorityClassName }}
{{- end }}
serviceAccountName: {{ include "tempo.serviceAccountName" . }}
{{- with .Values.tempo.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
enableServiceLinks: false
{{- include "tempo.memcachedExporterImagePullSecrets" . | nindent 6 -}}
{{- with .Values.memcachedExporter.hostAliases }}
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- image: {{ include "tempo.imageReference" $dict }}
imagePullPolicy: {{ .Values.memcached.image.pullPolicy }}
name: memcached
{{- with .Values.memcached.extraArgs }}
args:
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- containerPort: 11211
name: client
{{- with .Values.memcached.extraEnv }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.memcached.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.memcached.resources | nindent 12 }}
{{- with .Values.tempo.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.memcachedExporter.enabled }}
- args:
- --memcached.address=localhost:11211
- --web.listen-address=0.0.0.0:9150
image: {{ include "tempo.imageReference" (dict "ctx" . "component" "memcached-exporter") }}
imagePullPolicy: {{ .Values.memcachedExporter.image.pullPolicy }}
name: exporter
ports:
- containerPort: 9150
name: http-metrics
resources:
{{- toYaml .Values.memcachedExporter.resources | nindent 12 }}
{{- with .Values.tempo.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- if semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.memcached.topologySpreadConstraints }}
topologySpreadConstraints:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- end }}
{{- /*
{{- with .Values.memcached.affinity }}
affinity:
{{- tpl . $ | nindent 8 }}
{{- end }}
*/ -}}
{{- with .Values.memcached.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.memcached.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
updateStrategy:
type: RollingUpdate
{{- end}}
@@ -0,0 +1,49 @@
{{- define "tempo.metaMonitoring.metrics.remoteWrite" -}}
url: {{ .url }}
{{- if .auth }}
basicAuth:
{{- if .auth.username }}
username:
name: {{ include "tempo.resourceName" (dict "ctx" $.ctx "component" "metrics-instance-usernames") }}
key: {{ .usernameKey | quote }}
{{- end }}
{{- with .auth }}
{{- if and .passwordSecretKey .passwordSecretName }}
password:
name: {{ .passwordSecretName | quote }}
key: {{ .passwordSecretKey | quote }}
{{- else if or .passwordSecretKey .passwordSecretName }}{{ required "Set either both passwordSecretKey and passwordSecretName or neither" nil }}
{{- end }}
{{- end }}
{{- end }}
{{- with .headers }}
headers:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end -}}
{{- define "tempo.metaMonitoring.logs.client" -}}
url: {{ .url }}
{{- if .auth }}
{{- if .auth.tenantId }}
tenantId: {{ .auth.tenantId | quote }}
{{- end }}
basicAuth:
{{- if .auth.username }}
username:
name: {{ include "tempo.resourceName" (dict "ctx" $.ctx "component" "logs-instance-usernames") }}
key: {{ .usernameKey | quote }}
{{- end }}
{{- with .auth }}
{{- if and .passwordSecretKey .passwordSecretName }}
password:
name: {{ .passwordSecretName | quote }}
key: {{ .passwordSecretKey | quote }}
{{- else if or .passwordSecretKey .passwordSecretName }}
{{ required "Set either both passwordSecretKey and passwordSecretName or neither" nil }}
{{- end }}
{{- end }}
{{- end }}
externalLabels:
cluster: {{ include "tempo.clusterName" $.ctx | quote}}
{{- end -}}
@@ -0,0 +1,19 @@
{{- with (.Values.metaMonitoring).grafanaAgent }}
{{- if .enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" $ "component" "grafana-agent") }}
namespace: {{ .namespace | default $.Release.Namespace | quote }}
labels:
{{- include "tempo.labels" (dict "ctx" $ "component" "meta-monitoring" ) | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "tempo.resourceName" (dict "ctx" $ "component" "grafana-agent") }}
subjects:
- kind: ServiceAccount
name: {{ include "tempo.resourceName" (dict "ctx" $ "component" "grafana-agent") }}
namespace: {{ .namespace | default $.Release.Namespace }}
{{- end }}
{{- end }}
@@ -0,0 +1,39 @@
{{- with (.Values.metaMonitoring).grafanaAgent }}
{{- if .enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" $ "component" "grafana-agent") }}
namespace: {{ .namespace | default $.Release.Namespace | quote }}
labels:
{{- include "tempo.labels" (dict "ctx" $ "component" "meta-monitoring" ) | nindent 4 }}
rules:
- apiGroups:
- ""
resources:
- nodes
- nodes/proxy
- nodes/metrics
- services
- endpoints
- pods
- events
verbs:
- get
- list
- watch
- apiGroups:
- networking.k8s.io
resources:
- ingresses
verbs:
- get
- list
- watch
- nonResourceURLs:
- /metrics
- /metrics/cadvisor
verbs:
- get
{{- end }}
{{- end }}
@@ -0,0 +1,11 @@
{{- with (.Values.metaMonitoring).grafanaAgent }}
{{- if .enabled }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" $ "component" "grafana-agent") }}
namespace: {{ .namespace | default $.Release.Namespace | quote }}
labels:
{{- include "tempo.labels" (dict "ctx" $ "component" "meta-monitoring" ) | nindent 4 }}
{{- end }}
{{- end }}
@@ -0,0 +1,31 @@
{{- with (.Values.metaMonitoring).grafanaAgent }}
{{- if .enabled }}
apiVersion: monitoring.grafana.com/v1alpha1
kind: GrafanaAgent
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" $ "component" "meta-monitoring") }}
namespace: {{ .namespace | default $.Release.Namespace | quote }}
labels:
{{- include "tempo.labels" (dict "ctx" $ "component" "meta-monitoring" ) | nindent 4 }}
{{- with .labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
serviceAccountName: {{ include "tempo.resourceName" (dict "ctx" $ "component" "grafana-agent") }}
logs:
instanceSelector:
matchLabels:
{{- include "tempo.selectorLabels" (dict "ctx" $ "component" "meta-monitoring") | nindent 8 }}
# cluster label for logs is added in the LogsInstance
metrics:
instanceSelector:
matchLabels:
{{- include "tempo.selectorLabels" (dict "ctx" $ "component" "meta-monitoring") | nindent 8 }}
externalLabels:
cluster: {{ include "tempo.clusterName" $ }}
{{- end }}
{{- end }}
@@ -0,0 +1,44 @@
{{- if and ((.Values.metaMonitoring).grafanaAgent).enabled .Values.metaMonitoring.grafanaAgent.metrics.scrapeK8s.enabled }}
{{- with .Values.metaMonitoring.serviceMonitor }}
{{- if .enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" $ "component" "k8s-ksm") }}
namespace: {{ .namespace | default $.Release.Namespace | quote }}
labels:
{{- include "tempo.labels" (dict "ctx" $ "component" "meta-monitoring") | nindent 4 }}
{{- with .labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
endpoints:
- port: http-metrics
metricRelabelings:
- action: keep
regex: {{ include "tempo.resourceName" (dict "ctx" $) }}.*
sourceLabels:
- deployment
- statefulset
- pod
separator: ''
path: /metrics
honorLabels: true # retain namespace label from kube-state-metrics
{{- with .scrapeTimeout }}
scrapeTimeout: {{ . }}
{{- end }}
{{- with ((((($.Values).metaMonitoring).grafanaAgent).metrics).scrapeK8s).kubeStateMetrics }}
namespaceSelector:
matchNames:
- {{ .namespace }}
selector:
matchLabels:
{{- toYaml .labelSelectors | nindent 6 }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
@@ -0,0 +1,83 @@
{{- if and ((.Values.metaMonitoring).grafanaAgent).enabled .Values.metaMonitoring.grafanaAgent.metrics.scrapeK8s.enabled }}
{{- with .Values.metaMonitoring.serviceMonitor }}
{{- if .enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" $ "component" "k8s-kubelet-cadvisor") }}
namespace: {{ .namespace | default $.Release.Namespace | quote }}
labels:
{{- include "tempo.labels" (dict "ctx" $ "component" "meta-monitoring") | nindent 4 }}
{{- with .labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
endpoints:
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
{{- with .interval }}
interval: {{ . }}
{{- end }}
{{- with .scrapeTimeout }}
scrapeTimeout: {{ . }}
{{- end }}
port: https-metrics
honorLabels: true # retain namespace label from kubelet
relabelings:
- replacement: kubelet # add so that e.g. up{} metric doesn't get clashes with the other endpoint
targetLabel: source
{{- with .relabelings }}
{{- toYaml . | nindent 8 }}
{{- end }}
metricRelabelings:
- action: keep
regex: storage-{{ include "tempo.resourceName" (dict "ctx" $) }}.*
sourceLabels:
- persistentvolumeclaim # present on kubelet_volume_stats* metrics
- targetLabel: instance # replace so that the metrics work with the default metrics mixin
sourceLabels:
- node
scheme: https
tlsConfig:
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
{{- with .interval }}
interval: {{ . }}
{{- end }}
{{- with .scrapeTimeout }}
scrapeTimeout: {{ . }}
{{- end }}
path: /metrics/cadvisor
port: https-metrics
honorLabels: true # retain namespace label from cadvisor
relabelings:
- replacement: cadvisor # add so that e.g. up{} metric doesn't get clashes with the other endpoint
targetLabel: source
- targetLabel: instance # replace so that the metrics work with the default metrics mixin
sourceLabels:
- node
{{- with .relabelings }}
{{- toYaml . | nindent 8 }}
{{- end }}
metricRelabelings:
- action: keep
regex: {{ include "tempo.resourceName" (dict "ctx" $) }}.*
sourceLabels:
- pod
scheme: https
tlsConfig:
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
namespaceSelector:
matchNames:
# "default" is the default namespace in which the operator creates the kubelet service.
- default
selector:
matchLabels:
# This is a service added by the agent operator, so this labels is hardcoded to what the operator creates.
app.kubernetes.io/name: kubelet
{{- end -}}
{{- end -}}
{{- end -}}
@@ -0,0 +1,17 @@
{{- if ((.Values.metaMonitoring).grafanaAgent).enabled }}
{{- with .Values.metaMonitoring.grafanaAgent.logs }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" $ "component" "logs-instance-usernames") }}
namespace: {{ (($.Values.metaMonitoring).grafanaAgent).namespace | default $.Release.Namespace | quote }}
labels:
{{- include "tempo.labels" (dict "ctx" $ "component" "meta-monitoring") | nindent 4 }}
data:
{{- range $i, $cfg := prepend (.additionalClientConfigs | default list) .remote }}
{{- if (($cfg).auth).username }}
username-{{ $i }}: {{ (($cfg).auth).username | b64enc | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
@@ -0,0 +1,38 @@
{{- with (.Values.metaMonitoring).grafanaAgent }}
{{- if .enabled }}
apiVersion: monitoring.grafana.com/v1alpha1
kind: LogsInstance
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" $ "component" "meta-monitoring") }}
namespace: {{ (($.Values.metaMonitoring).grafanaAgent).namespace | default $.Release.Namespace | quote }}
labels:
{{- include "tempo.labels" (dict "ctx" $ "component" "meta-monitoring" ) | nindent 4 }}
{{- with .labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
clients:
{{- if or (.logs).additionalClientConfigs (.logs).remote }}
{{- range $i, $cfg := prepend ((.logs).additionalClientConfigs | default list) (.logs).remote }}
{{- with $cfg }}
{{- if $cfg.url }}
- {{- include "tempo.metaMonitoring.logs.client" (dict "ctx" $ "url" .url "auth" .auth "usernameKey" (printf "username-%d" $i)) | nindent 6 -}}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
# Supply an empty namespace selector to look in all namespaces. Remove
# this to only look in the same namespace as the LogsInstance CR
podLogsNamespaceSelector: {}
podLogsSelector:
matchLabels:
{{- include "tempo.selectorLabels" (dict "ctx" $) | nindent 6 }}
{{- end -}}
{{- end -}}
@@ -0,0 +1,17 @@
{{- if .Values.metaMonitoring.grafanaAgent.enabled }}
{{- with .Values.metaMonitoring.grafanaAgent.metrics }}
apiVersion: v1
kind: Secret
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" $ "component" "metrics-instance-usernames") }}
namespace: {{ $.Values.metaMonitoring.grafanaAgent.namespace | default $.Release.Namespace | quote }}
labels:
{{- include "tempo.labels" (dict "ctx" $ "component" "meta-monitoring") | nindent 4 }}
data:
{{- range $i, $cfg := prepend (.additionalRemoteWriteConfigs | default list) .remote }}
{{- if (($cfg).auth).username }}
username-{{ $i }}: {{ $cfg.auth.username | b64enc | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
@@ -0,0 +1,38 @@
{{- with .Values.metaMonitoring.grafanaAgent }}
{{- if .enabled }}
apiVersion: monitoring.grafana.com/v1alpha1
kind: MetricsInstance
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" $ "component" "meta-monitoring") }}
namespace: {{ $.Values.metaMonitoring.grafanaAgent.namespace | default $.Release.Namespace | quote }}
labels:
{{- include "tempo.labels" (dict "ctx" $ "component" "meta-monitoring" ) | nindent 4 }}
{{- with .labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
remoteWrite:
{{- if or (.metrics).additionalRemoteWriteConfigs (.metrics).remote }}
{{- range $i, $cfg := prepend ((.metrics).additionalRemoteWriteConfigs | default list) (.metrics).remote }}
{{- with $cfg }}
{{- if $cfg.url }}
- {{- include "tempo.metaMonitoring.metrics.remoteWrite" (dict "ctx" $ "url" .url "auth" .auth "usernameKey" (printf "username-%d" $i) "headers" .headers ) | nindent 6 -}}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
# Supply an empty namespace selector to look in all namespaces. Remove
# this to only look in the same namespace as the MetricsInstance CR
serviceMonitorNamespaceSelector: {}
serviceMonitorSelector:
# Scrape ServiceMonitors from all components
matchLabels:
{{- include "tempo.selectorLabels" (dict "ctx" $) | nindent 6 }}
{{- end }}
{{- end }}
@@ -0,0 +1,45 @@
{{- with (.Values.metaMonitoring).grafanaAgent }}
{{- if .enabled }}
apiVersion: monitoring.grafana.com/v1alpha1
kind: PodLogs
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" $ "component" "meta-monitoring") }}
namespace: {{ .namespace | default $.Release.Namespace | quote }}
labels:
{{- include "tempo.labels" (dict "ctx" $ "component" "meta-monitoring") | nindent 4 }}
{{- with .labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
pipelineStages:
- cri: { }
relabelings:
- action: replace # For consistency with metrics
replacement: $1
separator: /
sourceLabels:
- __meta_kubernetes_namespace
- __meta_kubernetes_pod_container_name
targetLabel: job
- action: replace # Necessary for slow queries dashboard
sourceLabels:
- __meta_kubernetes_pod_container_name
targetLabel: name
- targetLabel: cluster
replacement: {{ include "tempo.clusterName" $ }}
namespaceSelector:
matchNames:
- {{ $.Release.Namespace | quote }}
selector:
matchLabels:
# Scrape logs from all components
{{- include "tempo.selectorLabels" (dict "ctx" $) | nindent 6 }}
{{- end -}}
{{- end -}}
@@ -0,0 +1,7 @@
{{/*
metrics-generator imagePullSecrets
*/}}
{{- define "tempo.metricsGeneratorImagePullSecrets" -}}
{{- $dict := dict "tempo" .Values.tempo.image "component" .Values.metricsGenerator.image "global" .Values.global.image -}}
{{- include "tempo.imagePullSecrets" $dict -}}
{{- end }}
@@ -0,0 +1,134 @@
{{- if and (.Values.metricsGenerator.enabled) (eq .Values.metricsGenerator.kind "Deployment") }}
{{ $dict := dict "ctx" . "component" "metrics-generator" "memberlist" true }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "tempo.resourceName" $dict }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
{{- with .Values.metricsGenerator.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
minReadySeconds: 10
replicas: {{ .Values.metricsGenerator.replicas }}
revisionHistoryLimit: 10
selector:
matchLabels:
{{- include "tempo.selectorLabels" $dict | nindent 6 }}
template:
metadata:
labels:
{{- include "tempo.podLabels" $dict | nindent 8 }}
{{- with .Values.tempo.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.metricsGenerator.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap-tempo.yaml") . | sha256sum }}
{{- with .Values.tempo.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.metricsGenerator.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if or (.Values.metricsGenerator.priorityClassName) (.Values.global.priorityClassName) }}
priorityClassName: {{ default .Values.metricsGenerator.priorityClassName .Values.global.priorityClassName }}
{{- end }}
serviceAccountName: {{ include "tempo.serviceAccountName" . }}
{{- with .Values.tempo.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
enableServiceLinks: false
{{- include "tempo.metricsGeneratorImagePullSecrets" . | nindent 6 -}}
{{- with .Values.metricsGenerator.hostAliases }}
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- args:
- -target=metrics-generator
- -config.file=/conf/tempo.yaml
- -mem-ballast-size-mbs=1024
{{- with .Values.metricsGenerator.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
image: {{ include "tempo.imageReference" $dict }}
imagePullPolicy: {{ .Values.tempo.image.pullPolicy }}
name: metrics-generator
ports:
{{- range .Values.metricsGenerator.ports }}
- name: {{ .name | quote }}
containerPort: {{ .port }}
{{- end }}
{{- with .Values.metricsGenerator.extraEnv }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.metricsGenerator.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
readinessProbe:
{{- toYaml .Values.tempo.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.metricsGenerator.resources | nindent 12 }}
{{- with .Values.tempo.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- mountPath: /conf
name: config
- mountPath: /runtime-config
name: runtime-config
- mountPath: /var/tempo
name: wal
{{- if .Values.enterprise.enabled }}
- name: license
mountPath: /license
{{- end }}
{{- with .Values.metricsGenerator.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.metricsGenerator.terminationGracePeriodSeconds }}
{{- if semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.metricsGenerator.topologySpreadConstraints }}
topologySpreadConstraints:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.metricsGenerator.affinity }}
affinity:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- with .Values.metricsGenerator.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.metricsGenerator.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: config
{{- include "tempo.configVolume" . | nindent 10 }}
- name: runtime-config
{{- include "tempo.runtimeVolume" . | nindent 10 }}
{{- if .Values.enterprise.enabled }}
- name: license
secret:
secretName: {{ tpl .Values.license.secretName . }}
{{- end }}
- name: wal
emptyDir: {{- toYaml .Values.metricsGenerator.walEmptyDir | nindent 12 }}
{{- with .Values.metricsGenerator.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
@@ -0,0 +1,16 @@
{{- if .Values.metricsGenerator.enabled }}
{{- if gt (int .Values.metricsGenerator.replicas) 1 }}
{{ $dict := dict "ctx" . "component" "metrics-generator" "memberlist" true }}
apiVersion: {{ include "tempo.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ include "tempo.resourceName" $dict }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "tempo.selectorLabels" $dict | nindent 6 }}
maxUnavailable: 1
{{- end }}
{{- end }}
@@ -0,0 +1,32 @@
{{- if .Values.metricsGenerator.enabled }}
{{- $dict := dict "ctx" . "component" "metrics-generator" "memberlist" true }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "tempo.resourceName" $dict }}-discovery
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
prometheus.io/service-monitor: "false"
{{- with .Values.metricsGenerator.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: ClusterIP
clusterIP: None
ports:
{{- range .Values.metricsGenerator.ports }}
{{- if .service }}
- name: {{ .name | quote }}
port: {{ .port }}
protocol: TCP
targetPort: {{ .port }}
{{- if and (hasPrefix .name "grpc") ($.Values.metricsGenerator.appProtocol.grpc) }}
appProtocol: {{ $.Values.metricsGenerator.appProtocol.grpc }}
{{- end }}
{{- end }}
{{- end }}
selector:
{{- include "tempo.selectorLabels" $dict | nindent 4 }}
{{- end }}
@@ -0,0 +1,29 @@
{{- if .Values.metricsGenerator.enabled }}
{{- $dict := dict "ctx" . "component" "metrics-generator" "memberlist" true }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "tempo.resourceName" $dict }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
{{- with .Values.metricsGenerator.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ports:
{{- range .Values.metricsGenerator.ports }}
{{- if .service }}
- name: {{ .name | quote }}
port: {{ .port }}
protocol: TCP
targetPort: {{ .port }}
{{- if and (hasPrefix .name "grpc") ($.Values.metricsGenerator.appProtocol.grpc) }}
appProtocol: {{ $.Values.metricsGenerator.appProtocol.grpc }}
{{- end }}
{{- end }}
{{- end }}
selector:
{{- include "tempo.selectorLabels" $dict | nindent 4 }}
{{- end }}
@@ -0,0 +1 @@
{{- include "tempo.lib.serviceMonitor" (dict "ctx" $ "component" "metrics-generator" "memberlist" true) }}
@@ -0,0 +1,161 @@
{{- if and (.Values.metricsGenerator.enabled) (eq .Values.metricsGenerator.kind "StatefulSet") }}
{{ $dict := dict "ctx" . "component" "metrics-generator" "memberlist" true }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "tempo.resourceName" $dict }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
{{- with .Values.metricsGenerator.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
minReadySeconds: 10
replicas: {{ .Values.metricsGenerator.replicas }}
revisionHistoryLimit: 10
podManagementPolicy: Parallel
updateStrategy:
rollingUpdate:
partition: 0
selector:
matchLabels:
{{- include "tempo.selectorLabels" $dict | nindent 6 }}
template:
metadata:
labels:
{{- include "tempo.podLabels" $dict | nindent 8 }}
{{- with .Values.tempo.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.metricsGenerator.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap-tempo.yaml") . | sha256sum }}
{{- with .Values.tempo.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.metricsGenerator.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if or (.Values.metricsGenerator.priorityClassName) (.Values.global.priorityClassName) }}
priorityClassName: {{ default .Values.metricsGenerator.priorityClassName .Values.global.priorityClassName }}
{{- end }}
serviceAccountName: {{ include "tempo.serviceAccountName" . }}
{{- with .Values.tempo.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
enableServiceLinks: false
{{- include "tempo.metricsGeneratorImagePullSecrets" . | nindent 6 -}}
{{- with .Values.metricsGenerator.hostAliases }}
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
initContainers:
{{- toYaml .Values.metricsGenerator.initContainers | nindent 8 }}
containers:
- args:
- -target=metrics-generator
- -config.file=/conf/tempo.yaml
- -mem-ballast-size-mbs=1024
{{- with .Values.metricsGenerator.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
image: {{ include "tempo.imageReference" $dict }}
imagePullPolicy: {{ .Values.tempo.image.pullPolicy }}
name: metrics-generator
ports:
{{- range .Values.metricsGenerator.ports }}
- name: {{ .name | quote }}
containerPort: {{ .port }}
{{- end }}
{{- with .Values.metricsGenerator.extraEnv }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.metricsGenerator.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
readinessProbe:
{{- toYaml .Values.tempo.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.metricsGenerator.resources | nindent 12 }}
{{- with .Values.tempo.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- mountPath: /conf
name: config
- mountPath: /runtime-config
name: runtime-config
- mountPath: /var/tempo
name: wal
{{- if .Values.enterprise.enabled }}
- name: license
mountPath: /license
{{- end }}
{{- with .Values.metricsGenerator.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.metricsGenerator.terminationGracePeriodSeconds }}
{{- if semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.metricsGenerator.topologySpreadConstraints }}
topologySpreadConstraints:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.metricsGenerator.affinity }}
affinity:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- with .Values.metricsGenerator.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.metricsGenerator.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: config
{{- include "tempo.configVolume" . | nindent 10 }}
- name: runtime-config
{{- include "tempo.runtimeVolume" . | nindent 10 }}
{{- if .Values.enterprise.enabled }}
- name: license
secret:
secretName: {{ tpl .Values.license.secretName . }}
{{- end }}
{{- with .Values.metricsGenerator.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if not .Values.metricsGenerator.persistence.enabled }}
- name: wal
emptyDir: {{- toYaml .Values.metricsGenerator.walEmptyDir | nindent 12 }}
{{- else }}
volumeClaimTemplates:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
{{- with .Values.metricsGenerator.persistence.annotations }}
annotations:
{{- toYaml . | nindent 10 }}
{{- end }}
name: wal
spec:
accessModes:
- ReadWriteOnce
{{- with .Values.metricsGenerator.persistence.storageClass }}
storageClassName: {{ if (eq "-" .) }}""{{ else }}{{ . }}{{ end }}
{{- end }}
resources:
requests:
storage: {{ .Values.metricsGenerator.persistence.size | quote }}
{{- end }}
{{- end }}
@@ -0,0 +1,41 @@
{{- if .Values.rbac.pspEnabled }}
{{- if .Capabilities.APIVersions.Has "policy/v1/PodSecurityPolicy" }}
apiVersion: policy/v1
kind: PodSecurityPolicy
metadata:
name: {{ include "tempo.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" . | nindent 4 }}
spec:
privileged: false
allowPrivilegeEscalation: false
volumes:
- 'configMap'
- 'emptyDir'
- 'persistentVolumeClaim'
- 'secret'
- 'projected'
- 'downwardAPI'
hostNetwork: false
hostIPC: false
hostPID: false
runAsUser:
rule: 'MustRunAsNonRoot'
seLinux:
rule: 'RunAsAny'
supplementalGroups:
rule: 'MustRunAs'
ranges:
- min: 1
max: 65535
fsGroup:
rule: 'MustRunAs'
ranges:
- min: 1
max: 65535
readOnlyRootFilesystem: true
requiredDropCapabilities:
- ALL
{{- end }}
{{- end -}}
@@ -0,0 +1,23 @@
{{- with .Values.prometheusRule }}
{{- if .enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ include "tempo.fullname" $ }}
{{- with .namespace }}
namespace: {{ . }}
{{- end }}
{{- with .annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "tempo.labels" (dict "ctx" $) | nindent 4 }}
{{- with .labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
groups:
{{- toYaml .groups | nindent 4 }}
{{- end }}
{{- end }}
@@ -0,0 +1,7 @@
{{/*
querier imagePullSecrets
*/}}
{{- define "tempo.querierImagePullSecrets" -}}
{{- $dict := dict "tempo" .Values.tempo.image "component" .Values.querier.image "global" .Values.global.image -}}
{{- include "tempo.imagePullSecrets" $dict -}}
{{- end }}
@@ -0,0 +1,141 @@
{{ $dict := dict "ctx" . "component" "querier" "memberlist" true }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "tempo.resourceName" $dict }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
{{- with .Values.querier.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
minReadySeconds: 10
{{- if not .Values.querier.autoscaling.enabled }}
replicas: {{ .Values.querier.replicas }}
{{- end }}
revisionHistoryLimit: 10
selector:
matchLabels:
{{- include "tempo.selectorLabels" $dict | nindent 6 }}
strategy:
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
template:
metadata:
labels:
{{- include "tempo.podLabels" $dict | nindent 8 }}
{{- with .Values.tempo.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.querier.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap-tempo.yaml") . | sha256sum }}
{{- with .Values.tempo.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.querier.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if or (.Values.querier.priorityClassName) (.Values.global.priorityClassName) }}
priorityClassName: {{ default .Values.querier.priorityClassName .Values.global.priorityClassName }}
{{- end }}
serviceAccountName: {{ include "tempo.serviceAccountName" . }}
{{- with .Values.tempo.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
enableServiceLinks: false
{{- include "tempo.querierImagePullSecrets" . | nindent 6 -}}
{{- with .Values.querier.hostAliases }}
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- args:
- -target=querier
- -config.file=/conf/tempo.yaml
- -mem-ballast-size-mbs=1024
{{- with .Values.querier.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
image: {{ include "tempo.imageReference" $dict }}
imagePullPolicy: {{ .Values.tempo.image.pullPolicy }}
name: querier
ports:
- containerPort: {{ include "tempo.memberlistBindPort" . }}
name: http-memberlist
protocol: TCP
- containerPort: 3100
name: http-metrics
{{- with .Values.querier.extraEnv }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.querier.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.querier.resources | nindent 12 }}
{{- with .Values.tempo.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.tempo.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- mountPath: /conf
name: config
- mountPath: /runtime-config
name: runtime-config
- mountPath: /var/tempo
name: tempo-querier-store
{{- if .Values.enterprise.enabled }}
- name: license
mountPath: /license
{{- end }}
{{- with .Values.querier.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.querier.terminationGracePeriodSeconds }}
{{- if semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.querier.topologySpreadConstraints }}
topologySpreadConstraints:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.querier.affinity }}
affinity:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- with .Values.querier.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.querier.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: config
{{- include "tempo.configVolume" . | nindent 10 }}
- name: runtime-config
{{- include "tempo.runtimeVolume" . | nindent 10 }}
- name: tempo-querier-store
emptyDir: {}
{{- if .Values.enterprise.enabled }}
- name: license
secret:
secretName: {{ tpl .Values.license.secretName . }}
{{- end }}
{{- with .Values.querier.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
@@ -0,0 +1,45 @@
{{- if .Values.querier.autoscaling.enabled }}
{{- $apiVersion := include "tempo.hpa.apiVersion" . -}}
apiVersion: {{ $apiVersion }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" . "component" "querier") }}
labels:
{{- include "tempo.labels" (dict "ctx" . "component" "querier") | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "tempo.resourceName" (dict "ctx" . "component" "querier") }}
minReplicas: {{ .Values.querier.autoscaling.minReplicas }}
maxReplicas: {{ .Values.querier.autoscaling.maxReplicas }}
{{- with .Values.querier.autoscaling.behavior }}
behavior:
{{- toYaml . | nindent 4 }}
{{- end }}
metrics:
{{- with .Values.querier.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
{{- if (eq $apiVersion "autoscaling/v2") }}
target:
type: Utilization
averageUtilization: {{ . }}
{{- else }}
targetAverageUtilization: {{ . }}
{{- end }}
{{- end }}
{{- with .Values.querier.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
{{- if (eq $apiVersion "autoscaling/v2") }}
target:
type: Utilization
averageUtilization: {{ . }}
{{- else }}
targetAverageUtilization: {{ . }}
{{- end }}
{{- end }}
{{- end }}
@@ -0,0 +1,14 @@
{{- if gt (int .Values.querier.replicas) 1 }}
{{ $dict := dict "ctx" . "component" "querier" "memberlist" true }}
apiVersion: {{ include "tempo.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ include "tempo.resourceName" $dict }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "tempo.selectorLabels" $dict | nindent 6 }}
maxUnavailable: 1
{{- end }}
@@ -0,0 +1,26 @@
apiVersion: v1
kind: Service
metadata:
name: {{ template "tempo.resourceName" (dict "ctx" . "component" "querier") }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" (dict "ctx" . "component" "querier") | nindent 4 }}
{{- with .Values.querier.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ports:
- name: http-metrics
port: 3100
protocol: TCP
targetPort: 3100
- name: grpc
port: 9095
protocol: TCP
targetPort: 9095
{{- if .Values.querier.appProtocol.grpc }}
appProtocol: {{ .Values.querier.appProtocol.grpc }}
{{- end }}
selector:
{{- include "tempo.selectorLabels" (dict "ctx" . "component" "querier" "memberlist" true) | nindent 4 }}
@@ -0,0 +1 @@
{{- include "tempo.lib.serviceMonitor" (dict "ctx" $ "component" "querier" "memberlist" true) }}
@@ -0,0 +1,23 @@
{{/*
query image
*/}}
{{- define "tempo.queryImage" -}}
{{- $dict := dict "tempo" .Values.tempo.image "component" .Values.queryFrontend.query.image "global" .Values.global.image "defaultVersion" .Chart.AppVersion -}}
{{- include "tempo.tempoImage" $dict -}}
{{- end }}
{{/*
queryFrontend imagePullSecrets
*/}}
{{- define "tempo.queryFrontendImagePullSecrets" -}}
{{- $dict := dict "tempo" .Values.tempo.image "component" .Values.queryFrontend.image "global" .Values.global.image -}}
{{- include "tempo.imagePullSecrets" $dict -}}
{{- end }}
{{/*
query imagePullSecrets
*/}}
{{- define "tempo.queryImagePullSecrets" -}}
{{- $dict := dict "tempo" .Values.tempo.image "component" .Values.queryFrontend.query.image "global" .Values.global.image -}}
{{- include "tempo.imagePullSecrets" $dict -}}
{{- end }}
@@ -0,0 +1,175 @@
{{ $dict := dict "ctx" . "component" "query-frontend" }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "tempo.resourceName" $dict }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
{{- with .Values.queryFrontend.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
minReadySeconds: 10
{{- if not .Values.queryFrontend.autoscaling.enabled }}
replicas: {{ .Values.queryFrontend.replicas }}
{{- end }}
revisionHistoryLimit: 10
selector:
matchLabels:
{{- include "tempo.selectorLabels" $dict | nindent 6 }}
strategy:
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
template:
metadata:
labels:
{{- include "tempo.podLabels" $dict | nindent 8 }}
{{- with .Values.tempo.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.queryFrontend.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap-tempo.yaml") . | sha256sum }}
{{- with .Values.tempo.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.queryFrontend.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if or (.Values.queryFrontend.priorityClassName) (.Values.global.priorityClassName) }}
priorityClassName: {{ default .Values.queryFrontend.priorityClassName .Values.global.priorityClassName }}
{{- end }}
serviceAccountName: {{ include "tempo.serviceAccountName" . }}
{{- with .Values.tempo.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
enableServiceLinks: false
{{- include "tempo.queryImagePullSecrets" . | nindent 6 -}}
{{- with .Values.queryFrontend.hostAliases }}
hostAliases:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- args:
- -target=query-frontend
- -config.file=/conf/tempo.yaml
- -mem-ballast-size-mbs=1024
{{- with .Values.queryFrontend.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
image: {{ include "tempo.imageReference" $dict }}
imagePullPolicy: {{ .Values.tempo.image.pullPolicy }}
name: query-frontend
ports:
- containerPort: 3100
name: http-metrics
- containerPort: 9095
name: grpc
{{- with .Values.queryFrontend.extraEnv }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.queryFrontend.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.queryFrontend.resources | nindent 12 }}
{{- with .Values.tempo.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- mountPath: /conf
name: config
- mountPath: /runtime-config
name: runtime-config
- mountPath: /var/tempo
name: tempo-queryfrontend-store
{{- if .Values.enterprise.enabled }}
- name: license
mountPath: /license
{{- end }}
{{- with .Values.queryFrontend.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.queryFrontend.query.enabled }}
- args:
- --query.base-path=/
- --grpc-storage-plugin.configuration-file=/conf/tempo-query.yaml
- --query.bearer-token-propagation=true
{{- with .Values.queryFrontend.query.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
image: {{ include "tempo.queryImage" . }}
imagePullPolicy: {{ .Values.tempo.image.pullPolicy }}
name: tempo-query
ports:
- containerPort: {{ .Values.queryFrontend.service.port }}
name: jaeger-ui
- containerPort: 16687
name: jaeger-metrics
{{- with .Values.queryFrontend.query.extraEnv }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.queryFrontend.query.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.queryFrontend.query.resources | nindent 12 }}
{{- with .Values.tempo.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- mountPath: /conf
name: config
{{- with .Values.queryFrontend.query.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end}}
terminationGracePeriodSeconds: {{ .Values.queryFrontend.terminationGracePeriodSeconds }}
{{- if semverCompare ">= 1.19-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.queryFrontend.topologySpreadConstraints }}
topologySpreadConstraints:
{{- tpl . $ | nindent 8 }}
{{- end }}
{{- end }}
{{- /*
{{- with .Values.queryFrontend.affinity }}
affinity:
{{- tpl . $ | nindent 8 }}
{{- end }}
*/ -}}
{{- with .Values.queryFrontend.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.queryFrontend.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: config
{{- include "tempo.configVolume" . | nindent 10 }}
- name: runtime-config
{{- include "tempo.runtimeVolume" . | nindent 10 }}
- name: tempo-queryfrontend-store
emptyDir: {}
{{- if .Values.enterprise.enabled }}
- name: license
secret:
secretName: {{ tpl .Values.license.secretName . }}
{{- end }}
{{- with .Values.queryFrontend.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
@@ -0,0 +1,45 @@
{{- if .Values.queryFrontend.autoscaling.enabled }}
{{- $apiVersion := include "tempo.hpa.apiVersion" . -}}
apiVersion: {{ $apiVersion }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" . "component" "query-frontend") }}
labels:
{{- include "tempo.labels" (dict "ctx" . "component" "query-frontend") | nindent 4 }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "tempo.resourceName" (dict "ctx" . "component" "query-frontend") }}
minReplicas: {{ .Values.queryFrontend.autoscaling.minReplicas }}
maxReplicas: {{ .Values.queryFrontend.autoscaling.maxReplicas }}
{{- with .Values.queryFrontend.autoscaling.behavior }}
behavior:
{{- toYaml . | nindent 4 }}
{{- end }}
metrics:
{{- with .Values.queryFrontend.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
{{- if (eq $apiVersion "autoscaling/v2") }}
target:
type: Utilization
averageUtilization: {{ . }}
{{- else }}
targetAverageUtilization: {{ . }}
{{- end }}
{{- end }}
{{- with .Values.queryFrontend.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
{{- if (eq $apiVersion "autoscaling/v2") }}
target:
type: Utilization
averageUtilization: {{ . }}
{{- else }}
targetAverageUtilization: {{ . }}
{{- end }}
{{- end }}
{{- end }}
@@ -0,0 +1,54 @@
{{- if and .Values.queryFrontend.query.enabled .Values.queryFrontend.ingress.enabled -}}
{{ $dict := dict "ctx" . "component" "query-frontend" }}
{{- $ingressApiIsStable := eq (include "tempo.ingress.isStable" .) "true" -}}
{{- $ingressSupportsIngressClassName := eq (include "tempo.ingress.supportsIngressClassName" .) "true" -}}
{{- $ingressSupportsPathType := eq (include "tempo.ingress.supportsPathType" .) "true" -}}
apiVersion: {{ include "tempo.ingress.apiVersion" . }}
kind: Ingress
metadata:
name: {{ include "tempo.resourceName" $dict }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
{{- with .Values.queryFrontend.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and $ingressSupportsIngressClassName .Values.queryFrontend.ingress.ingressClassName }}
ingressClassName: {{ .Values.queryFrontend.ingress.ingressClassName }}
{{- end -}}
{{- if .Values.queryFrontend.ingress.tls }}
tls:
{{- range .Values.queryFrontend.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
{{- with .secretName }}
secretName: {{ . }}
{{- end }}
{{- end }}
{{- end }}
rules:
{{- range .Values.queryFrontend.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ .path }}
{{- if $ingressSupportsPathType }}
pathType: {{ .pathType }}
{{- end }}
backend:
{{- if $ingressApiIsStable }}
service:
name: {{ include "tempo.resourceName" $dict }}
port:
number: {{ $.Values.queryFrontend.service.port }}
{{- else }}
serviceName: {{ include "tempo.resourceName" $dict }}
servicePort: {{ $.Values.queryFrontend.service.port }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
@@ -0,0 +1,14 @@
{{- if gt (int .Values.queryFrontend.replicas) 1 }}
{{ $dict := dict "ctx" . "component" "query-frontend" }}
apiVersion: {{ include "tempo.pdb.apiVersion" . }}
kind: PodDisruptionBudget
metadata:
name: {{ include "tempo.resourceName" $dict }}
labels:
{{- include "tempo.labels" $dict | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "tempo.selectorLabels" $dict | nindent 6 }}
maxUnavailable: 1
{{- end }}
@@ -0,0 +1,46 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" . "component" "query-frontend-discovery") }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" (dict "ctx" . "component" "query-frontend") | nindent 4 }}
{{- with .Values.queryFrontend.serviceDiscovery.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.queryFrontend.serviceDiscovery.annotations }}
annotations:
{{ toYaml . | nindent 4 }}
{{- end }}
spec:
type: ClusterIP
clusterIP: None
ports:
- name: http
port: 3100
targetPort: 3100
- name: grpc
port: 9095
protocol: TCP
targetPort: 9095
{{- if .Values.queryFrontend.appProtocol.grpc }}
appProtocol: {{ .Values.queryFrontend.appProtocol.grpc }}
{{- end }}
- name: grpclb
port: 9096
protocol: TCP
targetPort: grpc
{{- if .Values.queryFrontend.appProtocol.grpc }}
appProtocol: {{ .Values.queryFrontend.appProtocol.grpc }}
{{- end }}
{{- if .Values.queryFrontend.query.enabled }}
- name: tempo-query-jaeger-ui
port: {{ .Values.queryFrontend.service.port }}
targetPort: {{ .Values.queryFrontend.service.port }}
- name: tempo-query-metrics
port: 16687
targetPort: jaeger-metrics
{{- end }}
publishNotReadyAddresses: true
selector:
{{- include "tempo.selectorLabels" (dict "ctx" . "component" "query-frontend") | nindent 4 }}
@@ -0,0 +1,44 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" . "component" "query-frontend") }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" (dict "ctx" . "component" "query-frontend") | nindent 4 }}
{{- with .Values.queryFrontend.service.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.queryFrontend.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.queryFrontend.service.type }}
ports:
- name: http-metrics
port: 3100
targetPort: 3100
- name: grpc
port: 9095
protocol: TCP
targetPort: 9095
{{- if .Values.queryFrontend.appProtocol.grpc }}
appProtocol: {{ .Values.queryFrontend.appProtocol.grpc }}
{{- end }}
{{- if .Values.queryFrontend.query.enabled }}
- name: tempo-query-jaeger-ui
port: {{ .Values.queryFrontend.service.port }}
targetPort: {{ .Values.queryFrontend.service.port }}
- name: tempo-query-metrics
port: 16687
targetPort: jaeger-metrics
{{- end }}
{{- if .Values.queryFrontend.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.queryFrontend.service.loadBalancerIP }}
{{- end }}
{{- with .Values.queryFrontend.service.loadBalancerSourceRanges}}
loadBalancerSourceRanges:
{{ toYaml . | nindent 4 }}
{{- end }}
selector:
{{- include "tempo.selectorLabels" (dict "ctx" . "component" "query-frontend") | nindent 4 }}
@@ -0,0 +1 @@
{{- include "tempo.lib.serviceMonitor" (dict "ctx" $ "component" "tempo-query") }}
@@ -0,0 +1 @@
{{- include "tempo.lib.serviceMonitor" (dict "ctx" $ "component" "query-frontend") }}
@@ -0,0 +1,16 @@
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ include "tempo.resourceName" (dict "ctx" .) }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" (dict "ctx" .) | nindent 4 }}
{{- if .Values.rbac.pspEnabled }}
rules:
- apiGroups: ['extensions']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames: [{{ include "tempo.resourceName" (dict "ctx" .) }}]
{{- end }}
{{- end }}
@@ -0,0 +1,16 @@
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ include "tempo.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" (dict "ctx" .) | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ include "tempo.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ include "tempo.serviceAccountName" . }}
{{- end }}
@@ -0,0 +1,18 @@
{{ if .Values.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "tempo.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "tempo.labels" (dict "ctx" .) | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }}
{{- with .Values.serviceAccount.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}
@@ -0,0 +1,7 @@
{{/*
tokengen-job imagePullSecrets
*/}}
{{- define "tempo.tokengenJobImagePullSecrets" -}}
{{- $dict := dict "tempo" .Values.tempo.image "component" .Values.tokengenJob.image "global" .Values.global.image -}}
{{- include "tempo.imagePullSecrets" $dict -}}
{{- end }}

Some files were not shown because too many files have changed in this diff Show More