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¶
Create a GitHub repository (or an equivalent VCS) Use this repository to hold your
fleet.yaml
file and any future updates or configurations.Add
fleet.yaml
to your repository Commit the following contents into your repo asfleet.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¶
Add the Observe Helm Repository
In Rancher, go to Cluster Management → Repositories.
Create a new repository with the following details:
URL:
https://observeinc.github.io/helm-charts
Create a Secret for Each Kubernetes Cluster
Select a cluster in Rancher, then navigate to Secrets.
Add a new secret with the following settings:
Type:
Opaque
Name: For example,
agent-credentials
.Namespace:
observe
(or another namespace, but presumablyobserve
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)
Add Your GitHub Repository in “Continuous Delivery”
Go to Continuous Delivery → Git Repos in Rancher.
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
)
Choose target clusters to deploy the Observe Agent.
Wait for Rancher to synchronize and deploy the Observe Agent to each selected cluster.
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.