Skip to main content

Install with Kubernetes

This guide explains how to install a Tracetest Agent in your Kubernetes environment. This deployment uses the Cloud-based managed Tracetest Control Plane and Dashboard.

Prerequisites​

Install the Tracetest Agent with Kubernetes​

Tracetest Agent runs as a Kubernetes Deployment with a Service.

tracetest-agent.yaml
---
# Service
apiVersion: v1
kind: Service
metadata:
name: tracetest-agent
labels:
app.kubernetes.io/name: tracetest-agent
app.kubernetes.io/instance: tracetest-agent
spec:
selector:
app.kubernetes.io/name: tracetest-agent
app.kubernetes.io/instance: tracetest-agent
ports:
- name: grpc-collector-entrypoint
protocol: TCP
port: 4317
targetPort: 4317
- name: http-collector-entrypoint
protocol: TCP
port: 4318
targetPort: 4318
---
# Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: tracetest-agent
labels:
app: tracetest-agent
app.kubernetes.io/name: tracetest-agent
app.kubernetes.io/instance: tracetest-agent
spec:
selector:
matchLabels:
app.kubernetes.io/name: tracetest-agent
app.kubernetes.io/instance: tracetest-agent
template:
metadata:
labels:
app.kubernetes.io/name: tracetest-agent
app.kubernetes.io/instance: tracetest-agent
spec:
containers:
- name: agent
image: "kubeshop/tracetest-agent:latest"
imagePullPolicy: Always
args: [
"--environment",
"<TRACETEST_ENVIRONMENT_ID>", # Add your env id
"--api-key",
"$TRACETEST_API_KEY",
"--server-url",
"https://app.tracetest.io",
]
env:
- name: TRACETEST_API_KEY
value: "<TRACETEST_API_KEY>" # Add your API key
Terminal
kubectl apply -f ./tracetest-agent.yaml

The Tracetest Agent is running in Kubernetes and ready to accept traces.

gRPC: http://tracetest-agent.default.svc.cluster.local:4317

HTTP: http://tracetest-agent.default.svc.cluster.local:4318/v1/traces

K8s Network

Make sure to check use the correct <service-name> if you edit the Tracetest Agent service name.

Running a test against localhost will resolve as 127.0.0.1 inside the Tracetest Agent container. Make sure to run tests using the internal Kubernetes service networking eg: http://api.default.svc.cluster.local:port.