Skip to content

Monitor a Cluster

UDS clusters include two Kubernetes controllers built with Pepr. By the end of this guide you’ll know how to:

  • Stream logs from both controllers in a single view
  • Filter logs by controller type or policy action
  • Use flags to control output format and history

UDS Core runs two Pepr-based controllers that uds monitor streams logs from:

ControllerPod prefixResponsibility
Admission Controllerpepr-uds-coreValidates and mutates resources; enforces UDS Exemptions
Operator Controllerpepr-uds-core-watcherManages lifecycle of UDS Package resources
  1. Confirm the controllers are running

    Terminal window
    uds zarf tools kubectl get pods -n pepr-system

    You should see pepr-uds-core-* and pepr-uds-core-watcher-* pods in a Running state before proceeding.

  2. Stream logs

    Run the command matching what you want to observe:

    All logs: aggregate admission and operator logs into a single stream:

    Terminal window
    uds monitor pepr

    Operator logs only: UDS Package processing, status updates, and errors:

    Terminal window
    uds monitor pepr operator

    All policy decisions (allow, deny, mutate):

    Terminal window
    uds monitor pepr policies

    Specific policy actions:

    Terminal window
    uds monitor pepr allowed # allow logs
    uds monitor pepr denied # deny logs
    uds monitor pepr mutated # mutation logs
    uds monitor pepr failed # deny + operator error logs
  3. (Optional) Refine with flags

    FlagDescription
    -f, --followContinuously stream logs (keep the session open)
    --jsonReturn raw JSON output
    --since <duration>Only show logs newer than the given duration (e.g., 5s, 2m, 3h). Defaults to all logs.
    -t, --timestampsShow timestamps in log output
    Terminal window
    # Follow all logs with timestamps
    uds monitor pepr --follow --timestamps
    # Show only the last 5 minutes of policy deny logs
    uds monitor pepr denied --since 5m
    # Get raw JSON for programmatic processing
    uds monitor pepr --json

Confirm logs are streaming by running:

Terminal window
uds monitor pepr --follow

You should see a continuous stream of admission and operator events as activity occurs in the cluster.

Symptom: uds monitor pepr returns immediately with no output.

Solution: Confirm the cluster is a UDS cluster with Pepr installed.

Symptom: An error connecting to the cluster when running uds monitor pepr.

Solution: Verify kubectl can reach the cluster with kubectl get nodes.

Symptom: Logs stop streaming after a short time.

Solution: Add --follow to keep the stream open.