mirror of
https://github.com/grafana/tempo.git
synced 2025-03-15 09:20:00 +00:00
Update helm examples (#2124)
* Update helm example for Kubernetes v1.22 deprecations Signed-off-by: Zach Leslie <zach.leslie@grafana.com> * Breadcrumbs for helm updates Signed-off-by: Zach Leslie <zach.leslie@grafana.com> * Breadcrumbs for helm updates Signed-off-by: Zach Leslie <zach.leslie@grafana.com> * Include enterprise example values Signed-off-by: Zach Leslie <zach.leslie@grafana.com> * Rename README file Signed-off-by: Zach Leslie <zach.leslie@grafana.com> * Updates for license information Signed-off-by: Zach Leslie <zach.leslie@grafana.com> * Rely more heavily on chart defaults Signed-off-by: Zach Leslie <zach.leslie@grafana.com> * Use a better license path Signed-off-by: Zach Leslie <zach.leslie@grafana.com> --------- Signed-off-by: Zach Leslie <zach.leslie@grafana.com>
This commit is contained in:
@ -1,13 +1,14 @@
|
||||
## Helm
|
||||
|
||||
Congratulations! You have successfully found the Helm examples. These examples are meant for
|
||||
advanced users looking to deploy Tempo in a microservices pattern. If you are just getting started
|
||||
might I recommend the [docker-compose examples](../docker-compose). The docker-compose examples also are much
|
||||
Congratulations! You have successfully found the Helm examples. These examples are meant for
|
||||
advanced users looking to deploy Tempo in a microservices pattern. If you are just getting started
|
||||
might I recommend the [docker-compose examples](../docker-compose). The docker-compose examples also are much
|
||||
better at demonstrating trace discovery flows using Loki and other tools.
|
||||
|
||||
If you're convinced this is the place for you then keep reading!
|
||||
|
||||
### Initial Steps
|
||||
|
||||
To test the Helm example locally requires:
|
||||
|
||||
- k3d > v3.2.0
|
||||
@ -16,12 +17,13 @@ To test the Helm example locally requires:
|
||||
Create a cluster
|
||||
|
||||
```console
|
||||
k3d cluster create tempo --api-port 6443 --port "3000:80@loadbalancer"
|
||||
k3d cluster create tempo --api-port 6443 --port "3000:80@loadbalancer" --agents 2
|
||||
```
|
||||
|
||||
Next either deploy the microservices or the single binary.
|
||||
|
||||
### Microservices
|
||||
|
||||
The microservices deploy of Tempo is fault tolerant, high volume, independently scalable.
|
||||
|
||||
> Note: double check you're applying to your local k3d before running this!
|
||||
@ -31,12 +33,12 @@ helm repo add grafana https://grafana.github.io/helm-charts
|
||||
helm repo update
|
||||
```
|
||||
|
||||
Install Tempo, Grafana and synthetic-load-generator
|
||||
Install Tempo, Grafana and run a K6 job against tempo.
|
||||
|
||||
```console
|
||||
helm upgrade -f microservices-tempo-values.yaml --install tempo grafana/tempo-distributed
|
||||
helm upgrade -f microservices-grafana-values.yaml --install grafana grafana/grafana
|
||||
kubectl create -f microservices-extras.yaml
|
||||
kubectl apply -f microservices-loadtest.yaml
|
||||
```
|
||||
|
||||
### Single Binary
|
||||
@ -44,7 +46,7 @@ kubectl create -f microservices-extras.yaml
|
||||
** Note: This method of deploying Tempo is referred to by documentation as "monolithic mode" **
|
||||
|
||||
The Tempo single binary configuration is currently setup to store traces locally on disk, but can easily be configured to
|
||||
store them in an S3 or GCS bucket. See configuration docs or some of the other examples for help.
|
||||
store them in an S3 or GCS bucket. See configuration docs or some of the other examples for help.
|
||||
|
||||
> Note: double check you're applying to your local k3d before running this!
|
||||
|
||||
@ -62,12 +64,14 @@ kubectl create -f single-binary-extras.yaml
|
||||
```
|
||||
|
||||
### View a trace
|
||||
|
||||
After the applications are running check the load generators logs
|
||||
|
||||
```console
|
||||
# you can find the exact pod name using `kubectl get pods`
|
||||
kubectl logs synthetic-load-generator-???
|
||||
```
|
||||
|
||||
```
|
||||
20/03/03 21:30:01 INFO ScheduledTraceGenerator: Emitted traceId e9f4add3ac7c7115 for service frontend route /product
|
||||
20/03/03 21:30:01 INFO ScheduledTraceGenerator: Emitted traceId 3890ea9c4d7fab00 for service frontend route /cart
|
53
example/helm/enterprise.yaml
Normal file
53
example/helm/enterprise.yaml
Normal file
@ -0,0 +1,53 @@
|
||||
---
|
||||
global:
|
||||
clusterDomain: 'cluster.local'
|
||||
|
||||
multitenancyEnabled: true
|
||||
enterprise:
|
||||
enabled: true
|
||||
image:
|
||||
tag: v2.0.1
|
||||
enterpriseGateway:
|
||||
enabled: true
|
||||
gateway:
|
||||
enabled: false
|
||||
minio:
|
||||
enabled: true
|
||||
# buckets:
|
||||
# - name: 'enterprise-traces'
|
||||
# - name: 'enterprise-admin'
|
||||
storage:
|
||||
trace:
|
||||
backend: s3
|
||||
s3:
|
||||
access_key: 'grafana-tempo'
|
||||
secret_key: 'supersecret'
|
||||
bucket: 'enterprise-traces'
|
||||
endpoint: 'tempo-minio:9000'
|
||||
insecure: true
|
||||
admin:
|
||||
backend: s3
|
||||
s3:
|
||||
access_key_id: 'grafana-tempo'
|
||||
secret_access_key: 'supersecret'
|
||||
bucket_name: 'enterprise-traces-admin'
|
||||
endpoint: 'tempo-minio:9000'
|
||||
insecure: true
|
||||
traces:
|
||||
otlp:
|
||||
http:
|
||||
enabled: true
|
||||
grpc:
|
||||
enabled: true
|
||||
distributor:
|
||||
config:
|
||||
log_received_spans:
|
||||
enabled: true
|
||||
|
||||
license:
|
||||
# Use a a secret that you create, or...
|
||||
# kubectl create secret generic tempo-license --from-file=license.jwt
|
||||
external: true
|
||||
# ...specify the license contents here.
|
||||
# contents: |
|
||||
# LICENSEGOESHERE
|
@ -1,18 +1,3 @@
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
annotations:
|
||||
ingress.kubernetes.io/ssl-redirect: "false"
|
||||
name: ingress
|
||||
namespace: default
|
||||
spec:
|
||||
rules:
|
||||
- http:
|
||||
paths:
|
||||
- backend:
|
||||
serviceName: grafana
|
||||
servicePort: 80
|
||||
path: /
|
||||
---
|
||||
apiVersion: v1
|
||||
data:
|
||||
@ -672,63 +657,18 @@ spec:
|
||||
name: synthetic-load-generator
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
- name: JAEGER_COLLECTOR_URL
|
||||
value: http://tempo-tempo-distributed-distributor:14268
|
||||
- name: TOPOLOGY_FILE
|
||||
value: /conf/load-generator.json
|
||||
image: omnition/synthetic-load-generator:1.0.25
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: synthetic-load-gen
|
||||
volumeMounts:
|
||||
- mountPath: /conf
|
||||
name: conf
|
||||
- env:
|
||||
- name: JAEGER_COLLECTOR_URL
|
||||
value: http://tempo-distributor:14268
|
||||
- name: TOPOLOGY_FILE
|
||||
value: /conf/load-generator.json
|
||||
image: omnition/synthetic-load-generator:1.0.25
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: synthetic-load-gen
|
||||
volumeMounts:
|
||||
- mountPath: /conf
|
||||
name: conf
|
||||
volumes:
|
||||
- configMap:
|
||||
name: synthetic-load-generator
|
||||
name: conf
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
name: minio
|
||||
name: minio
|
||||
namespace: default
|
||||
spec:
|
||||
ports:
|
||||
- port: 9000
|
||||
targetPort: 9000
|
||||
selector:
|
||||
app: minio
|
||||
name: minio
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: minio
|
||||
namespace: default
|
||||
spec:
|
||||
minReadySeconds: 10
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: minio
|
||||
name: minio
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: minio
|
||||
name: minio
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
- name: MINIO_ACCESS_KEY
|
||||
value: tempo
|
||||
- name: MINIO_SECRET_KEY
|
||||
value: supersecret
|
||||
image: minio/minio:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
name: minio
|
||||
command: ["sh"]
|
||||
args: ["-euc", "mkdir -p /data/tempo && /opt/bin/minio server /data --console-address ':9001'"]
|
||||
- configMap:
|
||||
name: synthetic-load-generator
|
||||
name: conf
|
||||
|
@ -1,8 +1,19 @@
|
||||
grafana.ini:
|
||||
server:
|
||||
domain: grafana.cluster.local
|
||||
root_url: '%(protocol)s://%(domain)s/grafana'
|
||||
serve_from_sub_path: true
|
||||
ingress:
|
||||
enabled: true
|
||||
hosts:
|
||||
- 'localhost'
|
||||
path: '/grafana'
|
||||
|
||||
env:
|
||||
GF_AUTH_ANONYMOUS_ENABLED: true
|
||||
GF_AUTH_ANONYMOUS_ORG_ROLE: 'Admin'
|
||||
GF_AUTH_DISABLE_LOGIN_FORM: true
|
||||
GF_FEATURE_TOGGLES_ENABLE: tempoSearch tempoBackendSearch
|
||||
GF_FEATURE_TOGGLES_ENABLE: tempoSearch,tempoServiceGraph,tempoApmTable,traceqlEditor
|
||||
|
||||
datasources:
|
||||
datasources.yaml:
|
||||
@ -13,10 +24,10 @@ datasources:
|
||||
type: tempo
|
||||
access: proxy
|
||||
orgId: 1
|
||||
url: http://tempo-tempo-distributed-query-frontend:3100
|
||||
url: http://tempo-gateway
|
||||
basicAuth: false
|
||||
isDefault: true
|
||||
version: 1
|
||||
editable: false
|
||||
apiVersion: 1
|
||||
uid: tempo
|
||||
uid: tempo
|
||||
|
100
example/helm/microservices-loadtest.yaml
Normal file
100
example/helm/microservices-loadtest.yaml
Normal file
@ -0,0 +1,100 @@
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: k6-tracing
|
||||
spec:
|
||||
backoffLimit: 1
|
||||
completions: 1
|
||||
parallelism: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
name: k6-tracing
|
||||
spec:
|
||||
containers:
|
||||
- args:
|
||||
- run
|
||||
- /config/param.js
|
||||
image: zalegrala/xk6-client-tracing:latest
|
||||
imagePullPolicy: Always
|
||||
name: k6-tracing
|
||||
ports:
|
||||
- containerPort: 6565
|
||||
name: none
|
||||
protocol: TCP
|
||||
resources: {}
|
||||
terminationMessagePath: /dev/termination-log
|
||||
terminationMessagePolicy: File
|
||||
volumeMounts:
|
||||
- mountPath: /config
|
||||
name: k6-tracing-config
|
||||
dnsPolicy: ClusterFirst
|
||||
restartPolicy: Never
|
||||
schedulerName: default-scheduler
|
||||
securityContext: {}
|
||||
terminationGracePeriodSeconds: 30
|
||||
volumes:
|
||||
- configMap:
|
||||
defaultMode: 420
|
||||
name: k6-tracing-config
|
||||
name: k6-tracing-config
|
||||
ttlSecondsAfterFinished: 604800
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: k6-tracing-config
|
||||
data:
|
||||
param.js: |
|
||||
import { sleep } from 'k6'
|
||||
import tracing from 'k6/x/tracing'
|
||||
import { randomIntBetween } from 'https://jslib.k6.io/k6-utils/1.2.0/index.js'
|
||||
|
||||
export let options = {
|
||||
vus: 1,
|
||||
duration: '3m',
|
||||
}
|
||||
|
||||
const client = new tracing.Client({
|
||||
endpoint: 'tempo-distributor:4317',
|
||||
exporter: tracing.EXPORTER_OTLP,
|
||||
insecure: true,
|
||||
headers: { 'X-Scope-OrgID': 'k6' },
|
||||
})
|
||||
|
||||
export default function () {
|
||||
let pushSizeTraces = randomIntBetween(2, 3)
|
||||
let pushSizeSpans = 0
|
||||
let t = []
|
||||
for (let i = 0; i < pushSizeTraces; i++) {
|
||||
let c = randomIntBetween(5, 35)
|
||||
pushSizeSpans += c
|
||||
|
||||
t.push({
|
||||
random_service_name: false,
|
||||
spans: {
|
||||
count: c,
|
||||
size: randomIntBetween(300, 30000),
|
||||
random_name: true,
|
||||
fixed_attrs: {
|
||||
test: 'test',
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
let gen = new tracing.ParameterizedGenerator(t)
|
||||
let traces = gen.traces()
|
||||
client.push(traces)
|
||||
|
||||
console.log(
|
||||
`Pushed ${pushSizeSpans} spans from ${pushSizeTraces} different traces. Here is a random traceID: ${
|
||||
t[Math.floor(Math.random() * t.length)].id
|
||||
}`
|
||||
)
|
||||
sleep(1)
|
||||
}
|
||||
|
||||
export function teardown() {
|
||||
client.shutdown()
|
||||
}
|
@ -1,63 +1,26 @@
|
||||
---
|
||||
global:
|
||||
clusterDomain: 'cluster.local'
|
||||
gateway:
|
||||
enabled: true
|
||||
minio:
|
||||
enabled: true
|
||||
storage:
|
||||
trace:
|
||||
backend: s3
|
||||
s3:
|
||||
access_key: 'grafana-tempo'
|
||||
secret_key: 'supersecret'
|
||||
bucket: 'tempo-traces'
|
||||
endpoint: 'tempo-minio:9000'
|
||||
insecure: true
|
||||
traces:
|
||||
jaeger:
|
||||
thriftHttp:
|
||||
otlp:
|
||||
http:
|
||||
enabled: true
|
||||
grpc:
|
||||
enabled: true
|
||||
distributor:
|
||||
config:
|
||||
log_received_spans:
|
||||
enabled: true
|
||||
config: |
|
||||
query_frontend:
|
||||
search:
|
||||
max_duration: 0
|
||||
multitenancy_enabled: false
|
||||
compactor:
|
||||
compaction:
|
||||
block_retention: 1440h
|
||||
distributor:
|
||||
receivers:
|
||||
jaeger:
|
||||
protocols:
|
||||
thrift_compact:
|
||||
endpoint: 0.0.0.0:6831
|
||||
thrift_binary:
|
||||
endpoint: 0.0.0.0:6832
|
||||
thrift_http:
|
||||
endpoint: 0.0.0.0:14268
|
||||
grpc:
|
||||
endpoint: 0.0.0.0:14250
|
||||
otlp:
|
||||
protocols:
|
||||
http:
|
||||
endpoint: 0.0.0.0:55681
|
||||
grpc:
|
||||
endpoint: 0.0.0.0:4317
|
||||
querier:
|
||||
frontend_worker:
|
||||
frontend_address: tempo-tempo-distributed-query-frontend-discovery:9095
|
||||
ingester:
|
||||
lifecycler:
|
||||
ring:
|
||||
replication_factor: 1
|
||||
kvstore:
|
||||
store: memberlist
|
||||
tokens_file_path: /var/tempo/tokens.json
|
||||
memberlist:
|
||||
abort_if_cluster_join_fails: false
|
||||
join_members:
|
||||
- tempo-tempo-distributed-gossip-ring
|
||||
overrides:
|
||||
per_tenant_override_config: /conf/overrides.yaml
|
||||
server:
|
||||
http_listen_port: 3100
|
||||
log_level: info
|
||||
grpc_server_max_recv_msg_size: 4.194304e+06
|
||||
grpc_server_max_send_msg_size: 4.194304e+06
|
||||
storage:
|
||||
trace:
|
||||
backend: s3
|
||||
s3:
|
||||
bucket: tempo
|
||||
endpoint: minio:9000
|
||||
access_key: tempo
|
||||
secret_key: supersecret
|
||||
insecure: true
|
||||
blocklist_poll: 5m
|
||||
wal:
|
||||
path: /var/tempo/wal
|
Reference in New Issue
Block a user