Skip to content
100 changes: 100 additions & 0 deletions examples/otel-demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# OpenTelemetry Demo app + HotRODapp + Jaeger + OpenSearch

This example provides a one-command deployment of a complete observability stack on Kubernetes:
- Jaeger (all-in-one) for tracing
- OpenSearch and OpenSearch Dashboards
- OpenTelemetry Demo application (multi-service web store)
- HotRod application

It is driven by `deploy-all.sh`, which supports both clean installs and upgrades.

## Prerequisites
- Kubernetes cluster reachable via `kubectl`
- Installed CLIs: `bash`, `git`, `curl`, `kubectl`, `helm`
- Network access to Helm repositories

## Quick start
- Clean install (removes previous releases/namespaces, then installs everything):
```bash path=null start=null
./deploy-all.sh clean
```
- Upgrade (default) — installs if missing, upgrades if present:
```bash path=null start=null
./deploy-all.sh
# or explicitly
./deploy-all.sh upgrade
```
- Specify Jaeger all-in-one image tag:
```bash path=null start=null
./deploy-all.sh upgrade <image-tag>
# Example
./deploy-all.sh upgrade latest
```

Environment variables:
- ROLLOUT_TIMEOUT: rollout wait timeout in seconds (default 600)

```bash path=null start=null
ROLLOUT_TIMEOUT=900 ./deploy-all.sh clean
```

## What gets deployed
- Namespace `opensearch`:
- OpenSearch (single node) StatefulSet
- OpenSearch Dashboards Deployment
- Namespace `jaeger`:
- Jaeger all-in-one Deployment (storage=none)
- HOTROD application
- Jaeger Query ClusterIP service (jaeger-query-clusterip)
- Namespace `otel-demo`:
- OpenTelemetry Demo (frontend, load-generator, and supporting services)


## Verifying the deployment
- Pods status:
```bash path=null start=null
kubectl get pods -n opensearch
kubectl get pods -n jaeger
kubectl get pods -n otel-demo
```
- Services:
```bash path=null start=null
kubectl get svc -n opensearch
kubectl get svc -n jaeger
kubectl get svc -n otel-demo
```


## Automatic port-forward using scrpit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a small typo in the heading: scrpit should be script in "Automatic port-forward using script"

Suggested change
## Automatic port-forward using scrpit
## Automatic port-forward using script

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

- OpenSearch Dashboards:
```bash path=null start=null
./start-port-forward.sh


## Customization
- Helm values provided in this directory:
- `opensearch-values.yaml`
- `opensearch-dashboard-values.yaml`
- `jaeger-values.yaml`
- `jaeger-config.yaml`
- `otel-demo-values.yaml`
- `jaeger-query-service.yaml`

You can adjust these files and re-run `./deploy-all.sh upgrade` to apply changes.

## Clean-up
- Clean uninstall using cleanup.sh :
```bash path=null start=null
./cleanup.sh
```
- Manual teardown:
```bash path=null start=null
helm uninstall opensearch -n opensearch || true
helm uninstall opensearch-dashboards -n opensearch || true
helm uninstall jaeger -n jaeger || true
helm uninstall otel-demo -n otel-demo || true
kubectl delete namespace opensearch jaeger otel-demo --ignore-not-found=true
```



89 changes: 89 additions & 0 deletions examples/otel-demo/cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#!/bin/bash

# Copyright (c) 2025 The Jaeger Authors.
# SPDX-License-Identifier: Apache-2.0

# OpenSearch Observability Stack Cleanup Script

main() {
echo "Starting OpenSearch Observability Stack Cleanup"

# Stop any existing port forwards
echo "Stopping any existing port-forward processes..."
pkill -f "kubectl port-forward" 2>/dev/null || true
echo "✅ Port-forward processes stopped"

# Uninstall OTEL Demo
echo " Uninstalling OTEL Demo..."
if helm list -n otel-demo | grep -q otel-demo; then
helm uninstall otel-demo -n otel-demo
echo "✅ OTEL Demo uninstalled"
else
echo "⚠️ OTEL Demo not found or already uninstalled"
fi

# Uninstall Jaeger
echo "Uninstalling Jaeger..."
if helm list -n jaeger | grep -q jaeger; then
helm uninstall jaeger -n jaeger
echo "✅ Jaeger uninstalled"
else
echo "⚠️ Jaeger not found or already uninstalled"
fi

# Uninstall OpenSearch Dashboards
echo "Uninstalling OpenSearch Dashboards..."
if helm list -n opensearch | grep -q opensearch-dashboards; then
helm uninstall opensearch-dashboards -n opensearch
echo "✅ OpenSearch Dashboards uninstalled"
else
echo "⚠️ OpenSearch Dashboards not found or already uninstalled"
fi

# Uninstall OpenSearch
echo " Uninstalling OpenSearch..."
if helm list -n opensearch | grep -q opensearch; then
helm uninstall opensearch -n opensearch
echo "✅ OpenSearch uninstalled"
else
echo "⚠️ OpenSearch not found or already uninstalled"
fi

# Wait for pods to terminate
echo "Waiting for pods to terminate..."
sleep 10

# Delete namespaces
echo "Deleting namespaces..."
for ns in otel-demo jaeger opensearch; do
if kubectl get namespace "$ns" > /dev/null 2>&1; then
kubectl delete namespace "$ns" --force --grace-period=0 2>/dev/null || true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dangerous use of --force --grace-period=0 flags for namespace deletion. This forces immediate termination without allowing pods to shut down gracefully, which can lead to data corruption, incomplete cleanup of resources, and potential resource leaks. The --force flag should be removed to allow proper graceful shutdown, or used only as a last resort with additional safety checks.

Suggested change
kubectl delete namespace "$ns" --force --grace-period=0 2>/dev/null || true
kubectl delete namespace "$ns" 2>/dev/null || true

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

echo "✅ Namespace $ns deleted"
else
echo "⚠️ Namespace $ns not found or already deleted"
fi
done

# Clean up any remaining resources (PVCs, etc.)
echo "Cleaning up any remaining PVCs..."
kubectl get pvc -A | grep -E "(opensearch|jaeger|otel-demo)" || echo "No remaining PVCs found"

# Final verification
echo "Performing final verification..."
remaining_pods=$(kubectl get pods -A | grep -E "(opensearch|jaeger|otel-demo)" || true)
if [ -z "$remaining_pods" ]; then
echo "All components cleaned up successfully!"
else
echo "⚠️ Some pods may still be terminating:"
echo "$remaining_pods"
echo "This is normal and they should disappear shortly"
fi

echo ""
echo "✅ Cleanup Complete!"
echo ""
echo " All OpenSearch observability stack components have been removed"
echo ""
}

main "$@"
Loading
Loading