Observer
Observer Agent

Install on Kubernetes

Deployment manifest with Secret-bound credentials.

The recommended deployment path for production. Single-replica Deployment, agent key delivered through a Kubernetes Secret.

Prerequisites

  • A Kubernetes cluster you can deploy into.
  • An agent key from the Observer console.
  • A reachable Prometheus URL inside the cluster (typically a Service in the monitoring namespace).

Steps

  1. Create a namespace and Secret

    kubectl create namespace observer
    kubectl create secret generic observer-agent \
      --namespace observer \
      --from-literal=agent-key='obs_live_...'
  2. Apply the Deployment

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: observer-agent
      namespace: observer
    spec:
      replicas: 1
      selector:
        matchLabels: { app: observer-agent }
      template:
        metadata:
          labels: { app: observer-agent }
        spec:
          containers:
            - name: agent
              image: ghcr.io/useobserver/agent:1.0.4
              imagePullPolicy: IfNotPresent
              ports:
                - { name: dashboard, containerPort: 10101 }
              env:
                - name: AGENT_KEY
                  valueFrom:
                    secretKeyRef: { name: observer-agent, key: agent-key }
                - name: CLOUD_SERVER_URL
                  value: https://use.observer
                - name: PROMETHEUS_SERVER_URL
                  value: http://prometheus.monitoring.svc.cluster.local:9090
              resources:
                requests: { cpu: "50m", memory: "64Mi" }
                limits:   { cpu: "500m", memory: "256Mi" }
    kubectl apply -f agent.yaml
  3. Confirm the connection

    Port-forward the dashboard:

    kubectl -n observer port-forward deploy/observer-agent 10101:10101

    Open http://localhost:10101. The Cloud panel reports last_heartbeat_at within 30 seconds. The console's Agents page marks the agent as running within 90 seconds.

Optional: dashboard Service

To expose the dashboard inside the cluster (without port-forward), add a ClusterIP Service. Do not expose the dashboard externally; the dashboard is operator-facing only.

apiVersion: v1
kind: Service
metadata:
  name: observer-agent
  namespace: observer
spec:
  type: ClusterIP
  selector: { app: observer-agent }
  ports:
    - { name: dashboard, port: 10101, targetPort: 10101 }
Was this page helpful?