Skip to content

Controller HTTP API ​

The controller (kubesonde-controller-manager) serves an HTTP API on port 2709. Port-forward it to reach the endpoints locally:

bash
kubectl --namespace kubesonde-system \
  port-forward deployment.apps/kubesonde-controller-manager 2709 &

All endpoints send permissive CORS headers, so the browser-based frontend can read them directly.

GET /probes ​

Returns the recorded probe state as a JSON object. This is the payload you export and load into the UI.

bash
curl -s localhost:2709/probes > probes.json

The response is an object, not a bare array. The probes live under items:

json
{
  "items": [ { "type": "Probe", "resultingAction": "Allow", ... } ],
  "errors": [ { "reason": "command terminated with exit code 1", "value": { ... } } ],
  "podNetworking": { "podA": [ { "port": "80", "ip": "10.0.0.1", "protocol": "TCP" } ] },
  "podConfigurationNetworking": { "podA": [ { "port": "80", "ip": "", "protocol": "TCP" } ] }
}
Top-level fieldTypeDescription
itemsarrayThe recorded probes (see the fields below).
errorsarrayProbes that failed to run, each with a reason and the offending probe under value.
podNetworkingobjectPer-pod observed open ports, keyed by pod name: { pod: [{ port, ip, protocol }] }.
podConfigurationNetworkingobjectPer-pod ports declared in the pod's configuration, same shape as podNetworking.

Each entry in items includes (fields are omitted when empty):

FieldTypeDescription
typestringProbe (a connection attempt) or Information.
expectedActionstringThe asserted outcome, if you set expected — Allow or Deny.
resultingActionstringThe observed outcome — Allow or Deny.
sourceobjectOrigin endpoint (see below).
destinationobjectDestination endpoint (see below).
destinationHostnamesstring[]Hostnames resolved for the destination.
protocolstringTransport protocol.
portstringDestination port (defaults to 80).
forwardedPortstringLocal forwarded port, when applicable.
timestampint64Unix timestamp of the probe.
debugOutputstringRaw output of the request (e.g. the HTTP code for TCP).

Each endpoint (source / destination) may include type (Pod, Service, or Internet), name, IPAddress, namespace, labels, deploymentName, and replicaSetName.

GET /probes/status ​

Reports whether probing has quiesced.

bash
curl -s localhost:2709/probes/status
json
{
  "complete": true,
  "count": 228,
  "window": 30000000000,
  "secondsSinceLastChange": 42.5
}
FieldTypeDescription
completebooltrue when at least one probe has been recorded and the count has been stable for window.
countintNumber of recorded probe items.
windowintQuiescence window as a duration in nanoseconds (30000000000 = 30s).
secondsSinceLastChangefloatHow long the count has been stable, or -1 if no probes have been recorded yet.

POST /probes/clear ​

Clears the recorded probe state on the controller. Useful when you want to re-run a scan from a clean slate without restarting the controller.

bash
curl -s -X POST localhost:2709/probes/clear

Notes ​

  • The controller keeps probing after complete becomes true; polling /probes again later can return more data.
  • Only GET is accepted on the two read endpoints; other methods return 405 Method Not Allowed.

Released under the Apache License 2.0.