官方向导
主要参考 Deploy Tempo with Helm 和 Get started with Grafana Tempo using the Helm chart 来部署,注意区分 tempo-distributed Helm chart 和 tempo Helm chart, 一般来说,本地测试使用 tempo Helm chart, 而生产环境可以使用 Tempo 的微服务部署方式 tempo-distributed.
自定义配置部署
我们可以创建一个 自定义配置文件, 比如 custom.yaml
, 来部署, 让后在部署时使用命令 -f custom.yaml
来指定配置文件, 而不是使用默认的 values.yaml
helm -n tempo-test install tempo grafana/tempo -f custom.yaml
custom.yaml 配置文件
---
server:
# -- HTTP server listen port
http_listen_port: 3100
tempo:
repository: grafana/tempo
tag: ""
pullPolicy: IfNotPresent
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistryKeySecretName
updateStrategy: RollingUpdate
resources: {}
# requests:
# cpu: 1000m
# memory: 4Gi
# limits:
# cpu: 2000m
# memory: 6Gi
memBallastSizeMbs: 1024
multitenancyEnabled: false
# -- If true, Tempo will report anonymous usage data about the shape of a deployment to Grafana Labs
reportingEnabled: true
metricsGenerator:
# -- If true, enables Tempo's metrics generator (https://grafana.com/docs/tempo/next/metrics-generator/)
enabled: false
remoteWriteUrl: "http://prometheus.monitoring:9090/api/v1/write"
# -- Configuration options for the ingester
ingester: {}
# -- Configuration options for the querier
querier: {}
# -- Configuration options for the query-fronted
queryFrontend: {}
retention: 24h
# Global overrides
global_overrides:
per_tenant_override_config: /conf/overrides.yaml
overrides: {}
storage:
trace:
backend: local
local:
path: /var/tempo/traces
wal:
path: /var/tempo/wal
# https://github.com/rancher/local-path-provisioner
persistence:
enabled: true
storageClassName: local-path
accessModes:
- ReadWriteOnce
size: 1Gi
securityContext:
runAsUser: 1000
runAsGroup: 1000
fsGroup: 2000
tempoQuery:
repository: grafana/tempo-query
tag: null
pullPolicy: IfNotPresent
enabled: true
traces:
otlp:
grpc:
enabled: false
http:
enabled: true
zipkin:
enabled: false
jaeger:
thriftHttp:
enabled: false
opencensus:
enabled: false
我们可以看到在 Tempo templates/statefulset.yaml 里的 persistence 的配置是 PersistentVolumeClaim (pvc)
那么我们就需要有相应的 pv 制备器(provisioner), 这里我们本地部署一般可以使用 local-path-provisioner 制备器
# https://github.com/rancher/local-path-provisioner
persistence:
enabled: true
storageClassName: local-path
accessModes:
- ReadWriteOnce
size: 1Gi
安装之前确保添加了所需要的 repository, 可以使用下面的命令添加和确认:
helm repo add grafana https://grafana.github.io/helm-charts
helm repo update
helm repo list -n tempo-test
执行安装
helm -n tempo-test install tempo grafana/tempo -f custom.yaml
可以看到相应的 pvc 和 pod 被创建出来了
评论区