From 19a8b3cb725554141e8d5c166060e44079f19735 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 7 Jan 2026 23:08:33 +0200 Subject: Migrate Tempo to ArgoCD GitOps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Created ArgoCD Application manifest for Tempo - Updated Justfile with ArgoCD commands (sync, argocd-status, restart) - Tested delete/re-deploy workflow - Verified Tempo is Synced and Healthy - OTLP receivers enabled on ports 4317 (gRPC) and 4318 (HTTP) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- f3s/argocd-apps/tempo.yaml | 97 ++++++++++++++++++++++++++++++++++++++++++++++ f3s/tempo/Justfile | 65 +++++++++++++++++++------------ 2 files changed, 138 insertions(+), 24 deletions(-) create mode 100644 f3s/argocd-apps/tempo.yaml (limited to 'f3s') diff --git a/f3s/argocd-apps/tempo.yaml b/f3s/argocd-apps/tempo.yaml new file mode 100644 index 0000000..0fd6bc1 --- /dev/null +++ b/f3s/argocd-apps/tempo.yaml @@ -0,0 +1,97 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: tempo + namespace: cicd + finalizers: + - resources-finalizer.argocd.argoproj.io +spec: + project: default + source: + repoURL: https://grafana.github.io/helm-charts + chart: tempo + targetRevision: 1.24.1 + helm: + releaseName: tempo + valuesObject: + # Grafana Tempo - Monolithic Mode Configuration + tempo: + # Retention policy for traces (7 days) + retention: 168h + + # Storage configuration - Local filesystem backend + storage: + trace: + backend: local + local: + path: /var/tempo/traces + wal: + path: /var/tempo/wal + + # Distributor configuration with OTLP receivers + receivers: + otlp: + protocols: + grpc: + endpoint: 0.0.0.0:4317 + http: + endpoint: 0.0.0.0:4318 + + # Persistence configuration using hostPath PV + persistence: + enabled: true + size: 10Gi + storageClassName: "" # Empty string for manual PV binding + accessModes: + - ReadWriteOnce + + # Service configuration + service: + type: ClusterIP + + # Resource limits + resources: + limits: + cpu: 1000m + memory: 2Gi + requests: + cpu: 500m + memory: 1Gi + + # Security context + securityContext: + fsGroup: 10001 + runAsUser: 10001 + runAsGroup: 10001 + runAsNonRoot: true + + # Disable components not needed in monolithic mode + gateway: + enabled: false + + # Monitoring integration with Prometheus + serviceMonitor: + enabled: true + labels: + release: prometheus + + # Test pod disabled + test: + enabled: false + + destination: + server: https://kubernetes.default.svc + namespace: monitoring + + syncPolicy: + automated: + prune: true + selfHeal: true + syncOptions: + - CreateNamespace=false + retry: + limit: 3 + backoff: + duration: 5s + factor: 2 + maxDuration: 1m diff --git a/f3s/tempo/Justfile b/f3s/tempo/Justfile index 361f5c6..4b93edb 100644 --- a/f3s/tempo/Justfile +++ b/f3s/tempo/Justfile @@ -1,33 +1,50 @@ -# Grafana Tempo deployment automation -# Following the pattern from Loki Justfile +NAMESPACE := "monitoring" +APP_NAME := "tempo" -install: - helm repo add grafana https://grafana.github.io/helm-charts || true - helm repo update - kubectl apply -f persistent-volumes.yaml - helm install tempo grafana/tempo --namespace monitoring -f values.yaml - kubectl apply -f datasource-configmap.yaml +status: + @echo "=== Pods ===" + @kubectl get pods -n {{NAMESPACE}} -l app.kubernetes.io/name=tempo + @echo "" + @echo "=== Service ===" + @kubectl get svc -n {{NAMESPACE}} tempo + @echo "" + @echo "=== PVC ===" + @kubectl get pvc -n {{NAMESPACE}} | grep tempo + @echo "" + @echo "=== ArgoCD Status ===" + @kubectl get application {{APP_NAME}} -n cicd -o jsonpath='Sync: {.status.sync.status}, Health: {.status.health.status}' 2>/dev/null && echo "" -uninstall: - kubectl delete -f datasource-configmap.yaml || true - helm uninstall tempo --namespace monitoring || true - kubectl delete -f persistent-volumes.yaml || true +logs lines="100": + kubectl logs -n {{NAMESPACE}} -l app.kubernetes.io/name=tempo --tail={{lines}} -f -upgrade: - helm upgrade tempo grafana/tempo --namespace monitoring -f values.yaml - kubectl apply -f datasource-configmap.yaml +port-forward port="3200": + @echo "Forwarding Tempo to localhost:{{port}}" + kubectl port-forward -n {{NAMESPACE}} svc/tempo {{port}}:3200 -status: - kubectl get pods -n monitoring -l app.kubernetes.io/name=tempo - kubectl get svc -n monitoring -l app.kubernetes.io/name=tempo - kubectl get pvc -n monitoring tempo-data-pvc +port-forward-otlp-grpc port="4317": + @echo "Forwarding Tempo OTLP gRPC to localhost:{{port}}" + kubectl port-forward -n {{NAMESPACE}} svc/tempo {{port}}:4317 + +port-forward-otlp-http port="4318": + @echo "Forwarding Tempo OTLP HTTP to localhost:{{port}}" + kubectl port-forward -n {{NAMESPACE}} svc/tempo {{port}}:4318 + +sync: + @echo "Triggering ArgoCD sync..." + @kubectl annotate application {{APP_NAME}} -n cicd argocd.argoproj.io/refresh=normal --overwrite + @sleep 2 + @kubectl get application {{APP_NAME}} -n cicd -o jsonpath='Sync: {.status.sync.status}, Health: {.status.health.status}' && echo "" + +argocd-status: + argocd app get {{APP_NAME}} --core -logs: - kubectl logs -n monitoring -l app.kubernetes.io/name=tempo --tail=100 -f +restart: + @echo "Restarting Tempo..." + kubectl rollout restart -n {{NAMESPACE}} statefulset/tempo check: @echo "Checking Tempo readiness..." - kubectl exec -n monitoring $(kubectl get pod -n monitoring -l app.kubernetes.io/name=tempo -o jsonpath='{.items[0].metadata.name}') -- wget -qO- http://localhost:3200/ready + @kubectl exec -n {{NAMESPACE}} tempo-0 -- wget -qO- http://localhost:3200/ready @echo "" - @echo "Checking OTLP ports..." - kubectl exec -n monitoring $(kubectl get pod -n monitoring -l app.kubernetes.io/name=tempo -o jsonpath='{.items[0].metadata.name}') -- netstat -ln | grep -E ':(4317|4318|3200)' + @echo "Testing OTLP endpoint with tracing-demo:" + @echo " curl https://tracing-demo.f3s.buetow.org/api/process" -- cgit v1.2.3