QuickstartInstall on Kubernetes

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

Create a namespace and Secret

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

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.2.0
          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

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.

Replica count

Run a single replica per agent identity. The agent's local queue uses an embedded SQLite file inside the container; running two pods with the same key splits the queue and confuses the cloud's agent.offline detection.

Pinning

Pin to an exact version (agent:1.2.0). Track new releases at github.com/useobserver/agent/releases and roll forward when ready.

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 }