☸️ Deploying the Helios OpenTelemetry SDK in a Kubernetes (K8s) cluster

Follow the instructions below to install and update the Helios OpenTelemetry SDK in a centralized manner when running multiple containers by leveraging deployment with Kubernetes operator.

In order to install Helios in your K8s cluster, you need to perform the following steps:

  1. Verify cert-manager is installed in your cluster
  2. Install the OpenTelemetry K8s operator
  3. Install the Helios instrumentation resource
  4. Add instrumentation annotations to your Deployments

Verify that cert-manager is installed

If you don't already have the cert-manager installed in your cluster (verify by running kubectl get namespaces and check if cert-manager is listed), install the cert-manager in your cluster by calling:

kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.12.0/cert-manager.yaml

AWS EKS Fargate

If you're running on EKS Fargate you should adapt the cert-manager.yml file by updating the secure port of the cert-manager-webhook to 10260. Look for cert-manager-webhook deployment and update all 10250 ports to 10260.

Please notice that Fargate Profiles must be created for the cert-manager as well as the opentelemetry-operator-system namespaces.

GCP GKE Autopilot

If you're running on GKE Autopilot you should adapt the cert-manager.yml file by updating all kube-system resource namespaces to cert-manager (specifically for all cert-manager-cainjector:leaderelection resources).

Install the Helios OpenTelemetry Kubernetes operator

Install the OpenTelemetry Kubernetes operator by calling:

kubectl apply -f https://github.com/helios/opentelemetry-operator/releases/download/v0.0.5/opentelemetry-operator.yaml

Install the Helios instrumentation resource

Install the Helios instrumentation resource in your cluster in the namespace of your instrumented services:

kubectl apply -f - <<EOF
apiVersion: opentelemetry.io/v1alpha1
kind: Instrumentation
metadata:
  name: helios-instrumentation
  namespace: opentelemetry-operator-system
spec:
  java:
    image: gethelios/helios-java-autoinstrumentation
  nodejs:
    image: gethelios/helios-nodejs-autoinstrumentation
  python:
    image: gethelios/helios-python-autoinstrumentation
EOF

📘

Helios instrumentation resource supports currently Java, Node.js, and Python services.

Add instrumentation annotations to your Deployments

Now, edit the Deployments you wish to instrument by adding annotations under spec/template/metadata (choose your service's programming language):

annotations:
        instrumentation.opentelemetry.io/inject-java: "opentelemetry-operator-system/helios-instrumentation"
annotations:
        instrumentation.opentelemetry.io/inject-nodejs: "opentelemetry-operator-system/helios-instrumentation"
annotations:
        instrumentation.opentelemetry.io/inject-python: "opentelemetry-operator-system/helios-instrumentation"

Alternatively you can use the kubectl command to add the annotation to a Deployment (choose your service's programming language):

kubectl patch deployment DEPLOYMENT_NAME -p '{"spec":{"template":{"metadata":{"annotations":{"instrumentation.opentelemetry.io/inject-java":"opentelemetry-operator-system/helios-instrumentation"}}}}}'
kubectl patch deployment DEPLOYMENT_NAME -p '{"spec":{"template":{"metadata":{"annotations":{"instrumentation.opentelemetry.io/inject-nodejs":"opentelemetry-operator-system/helios-instrumentation"}}}}}'
kubectl patch deployment DEPLOYMENT_NAME -p '{"spec":{"template":{"metadata":{"annotations":{"instrumentation.opentelemetry.io/inject-python":"opentelemetry-operator-system/helios-instrumentation"}}}}}'

Configure environment variables

Finally, add the following environment variables to your Deployments config:

env:
  - name: HS_TOKEN
    value: your helios token (get this after signing up to Helios)
  - name: HS_ENVIRONMENT 
    value: your environment name

👍

Redeploy your Deployments and you should be all set to get instrumented data from Helios.