Skip to content
Last9
Book demo

Kubernetes Operator

Deploy OpenTelemetry Operator for automatic instrumentation and observability in Kubernetes clusters

Deploy OpenTelemetry Operator, Collector, and Cluster Monitoring via automated setup script.

Prerequisites

  • Kubernetes cluster (v1.19+), kubectl configured, helm 3.9+
  • Cluster admin access
  • Last9 credentials from the Integrations page

Installation

curl -O https://raw.githubusercontent.com/last9/last9-k8s-observability/main/last9-otel-setup.sh
chmod +x last9-otel-setup.sh
./last9-otel-setup.sh \
endpoint="$last9_otlp_endpoint" \
token="$last9_otlp_auth_header" \
monitoring-endpoint="$last9_remote_write_url" \
username="$last9_remote_write_username" \
password="$last9_remote_write_password"

Verification

kubectl get pods -n last9

Auto-Instrumentation

Add the annotation to your deployment:

annotations:
instrumentation.opentelemetry.io/inject-java: "last9/l9-instrumentation"

Then restart your deployment:

kubectl rollout restart deployment/my-app -n <namespace>

Advanced Configuration

Set environment and cluster name:

./last9-otel-setup.sh \
endpoint="$last9_otlp_endpoint" \
token="$last9_otlp_auth_header" \
monitoring-endpoint="$last9_remote_write_url" \
username="$last9_remote_write_username" \
password="$last9_remote_write_password" \
env=production \
cluster=my-cluster

Deploy on tainted nodes:

./last9-otel-setup.sh \
endpoint="$last9_otlp_endpoint" \
token="$last9_otlp_auth_header" \
monitoring-endpoint="$last9_remote_write_url" \
username="$last9_remote_write_username" \
password="$last9_remote_write_password" \
tolerations-file=/absolute/path/to/tolerations.yaml

Uninstall

./last9-otel-setup.sh uninstall-all

Troubleshooting

# Operator not starting
kubectl logs -n opentelemetry-operator-system deployment/opentelemetry-operator-controller-manager
# App not instrumented
kubectl describe pod <your-app-pod> | grep instrumentation.opentelemetry.io
kubectl get instrumentation -n last9 -o yaml
# Collector issues
kubectl logs -n last9 <collector-pod-name> | grep -i error

Please get in touch with us on Discord or Email if you have any questions.