本文内容可能已过期
如何部署Tempo取决于我们的tracing需求。Tempo有两种部署模式:单体式或微服务式。当使用Helm在Kubernetes集群上部署Tempo时,对这两种模式都支持。
使用Tempo的Helm Charts可以在Kubernetes集群中配置、安装和升级Tempo。
Tempo的仓库中有一个示例Helm Chart,展示了一个完整的基于微服务的部署。
Tempo有两个主要的Helm Chart用于部署:
tempo-distributed以微服务模式部署Tempotempo以单体模式(单一二进制文件)部署Tempo
这里将使用tempo-distributed来演示Tempo的部署。将按照以下步骤进行:
- 在Kubernetes集群中创建自定义命名空间
- 下载Helm Chart
- 定制Helm Chart的values.yaml配置,并配置使用外部的MinIO S3存储
- 使用Helm安装Tempo
1.在Kubernetes集群中创建自定义命名空间
使用自定义命名空间可以在后续遇到问题时方便清理工作:
kubectl create namespace tempo-test2.下载Helm Chart
下载tempo-distributed这个helm chart,这里下载的是1.4.2版本:
wget https://github.com/grafana/helm-charts/releases/download/tempo-distributed-1.4.2/tempo-distributed-1.4.2.tgz3.定制Helm Chart值
创建一个values.yaml文件:
---
storage:
trace:
backend: s3
s3:
access_key: 'grafana-tempo'
secret_key: 'supersecret'
bucket: 'tempo-traces'
endpoint: 'tempo-minio:9000'
insecure: true
minio:
enabled: false
traces:
otlp:
grpc:
enabled: true
http:
enabled: true
zipkin:
enabled: false
jaeger:
thriftHttp:
enabled: false
opencensus:
enabled: false4.使用Helm安装Tempo
helm -n tempo-test install tempo ./tempo-distributed-1.4.2.tgz -f values.yaml使用以上定制的values.yaml安装tempo后,启动了以下Pod:
k get po -n tempo-test
NAME READY STATUS RESTARTS AGE
tempo-compactor-79d94c55c6-ncfjl 1/1 Running 0 4m11s
tempo-distributor-c4c797d9f-4jx5k 1/1 Running 0 4m11s
tempo-gateway-78f4b54d56-jl5bz 1/1 Running 0 4m11s
tempo-ingester-0 1/1 Running 0 4m11s
tempo-ingester-1 1/1 Running 0 4m11s
tempo-ingester-2 1/1 Running 0 4m11s
tempo-querier-5569795f85-8nvgv 1/1 Running 0 4m11s
tempo-query-frontend-5885b78c84-4cfr6 1/1 Running 0 4m11stempo-gatewy的Ingress可以将query-frontend暴露到K8S集群外部。下面从K8S集群外部通过访问tempo的API验证一下:
curl -u user:pwd https://tempo-gateway.example.com/api/echo
echo