Deploy the Observe Agent to Multiple Kubernetes Clusters Using Rancher

You can simplify deployment of the Observe Agent across multiple Kubernetes clusters by leveraging Rancher. Follow the steps below to configure Rancher with your fleet.yaml file, add necessary secrets, and manage distribution via Continuous Delivery.

Prepare fleet.yaml

  1. Create a GitHub repository (or an equivalent VCS) Use this repository to hold your fleet.yaml file and any future updates or configurations.

  2. Add fleet.yaml to your repository Commit the following contents into your repo as fleet.yaml. Replace <YOUR OBSERVE COLLECTION ENDPOINT> with your instance’s collection endpoint (ex: https://123456789012.collect.observeinc.com/).

defaultNamespace: observe

helm:
  chart: "agent"                    # chart name
  repo: "https://observeinc.github.io/helm-charts"
  # version: "0.51.1"

  # Enable or confirm "disablePreProcess" is false so Fleet processes templating.
  # (This is usually the default, but some Fleet versions require you to specify.)
  disablePreProcess: false
  
  values:
    agent:
      selfMonitor:
        enabled: false
    application:
      prometheusScrape:
        # Set it to false if you don't want to use Prometheus Autodiscovery to scrape Prometheus metrics from your pods. 
        enabled: true
    cluster:
      events:
        enabled: true
      metrics:
        enabled: true
      # If a cluster does not have the env label, the expansion becomes an empty string—meaning the name might become "-monitored-cluster". 
      # If you want a fallback, you can do something like:
      name: "${ .ClusterLabels.env | default \"unknown\" }-observe-monitored-cluster"
    node:
      enabled: true
      containers:
        logs:
          enabled: true
        metrics:
          enabled: true
      forwarder:
        enabled: true
        traces:
          enabled: true
        metrics:
          enabled: true
        logs:
          enabled: true
    observe:
      collectionEndpoint:
        value: "<YOUR OBSERVE COLLECTION ENDPOINT>"
      token:
        create: false
      traceToken:
        create: false

Configure Rancher

  1. Add the Observe Helm Repository

    1. In Rancher, go to Cluster Management → Repositories.

    2. Create a new repository with the following details:

      • URL: https://observeinc.github.io/helm-charts

    Attributes
  2. Create a Secret for Each Kubernetes Cluster

    1. Select a cluster in Rancher, then navigate to Secrets.

    2. Add a new secret with the following settings:

      • Type: Opaque

      • Name: For example, agent-credentials.

      • Namespace: observe (or another namespace, but presumably observe if you’re deploying the Observe Agent there).

      • Key-Value Pairs:

        • Key: OBSERVE_TOKEN, Value: ds1gF7ZGV52S... (your token)

        • Key: TRACE_TOKEN, Value: ds1g123123... (trace token)

    Attributes
  3. Add Your GitHub Repository in “Continuous Delivery”

    1. Go to Continuous Delivery → Git Repos in Rancher.

    2. Add a new Git repository:

      • URL: the link to the repository containing your fleet.yaml. (e.g., https://github.com/observeinc/observe-rancher-test.git)

    Attributes
    1. Choose target clusters to deploy the Observe Agent.

    Attributes
    1. Wait for Rancher to synchronize and deploy the Observe Agent to each selected cluster.

    Attributes
  4. Verify Deployment Once the process completes, check Kubernetes Explorer in your Observe account (or your chosen monitoring view) to confirm the Observe Agent is reporting data as expected.

    Attributes