Skip to content

Kubesonde resource reference ​

Kubesonde is driven by a single custom resource, Kubesonde, in the API group security.kubesonde.io/v1.

yaml
apiVersion: security.kubesonde.io/v1
kind: Kubesonde
metadata:
  name: kubesonde-sample
spec:
  namespace: default
  probe: all

spec ​

FieldTypeDefaultDescription
namespacestring—Target namespace whose pods will be probed.
probestring—Default probing behavior: all probes every pod-to-pod pair; none probes nothing unless explicitly included.
debuggerImagestringinstrumentisto/nmap:latestOverride the image used for the debugger (probe) container.
monitorImagestringghcr.io/kubesonde/gonetstat:latestOverride the image used for the monitor container.
excludelist(optional)Connections to skip during probing. See entry fields.
includelist(optional)Connections to explicitly probe, optionally with an expected outcome.

include / exclude entry fields ​

Each entry in include and exclude accepts:

FieldTypeDefaultDescription
fromPodSelectorstring—Selector for the source pod(s).
toPodSelectorstring—Selector for the destination pod(s).
portstring"80"Destination port to probe.
protocolstringTCPTransport protocol.
expectedstring(include only)Asserts the expected outcome: Allow or Deny.

port is a string

In the CRD schema port and protocol are strings. Quote numeric ports in YAML — port: "8080" — to avoid validation errors.

Example with include/exclude ​

yaml
apiVersion: security.kubesonde.io/v1
kind: Kubesonde
metadata:
  name: shop-audit
spec:
  namespace: shop
  probe: all
  exclude:
    - fromPodSelector: { matchLabels: { app: web } }
      toPodSelector:   { matchLabels: { app: metrics } }
      port: "9090"
      protocol: TCP
  include:
    - fromPodSelector: { matchLabels: { app: web } }
      toPodSelector:   { matchLabels: { app: db } }
      port: "80"
      protocol: TCP
      expected: Deny

status ​

The resource reports progress in its status:

FieldTypeDescription
completebooltrue when the recorded probe count has been stable for the completeness window (probing has quiesced).
probeCountintNumber of probes recorded so far for this Kubesonde.
lastProbeTimetimestampWhen probing last ran.
conditionslistStandard conditions. The Complete condition is set to True once probing quiesces, so you can use kubectl wait --for=condition=Complete.

Completeness is a hint, not a stop

complete: true means results have stabilized enough to read — it does not mean Kubesonde stopped. The controller keeps probing continuously. See Probe completeness.

Accepted values ​

ConstantValues
probeall, none
expectedAllow, Deny

Watching a resource ​

bash
kubectl get kubesondes
kubectl wait --for=condition=Complete kubesonde/kubesonde-sample --timeout=300s
kubectl explain kubesonde.spec

Released under the Apache License 2.0.