KubeCon EUBooth 1151, Amsterdam. March 23-26
Network Operator

Configuration

Configure the Network Operator -- collection mode, intervals, environment variables, and resource tuning.

Configuration

The Network Operator (zxporter-netmon) is configured through a combination of command-line flags and environment variables, typically set via the Helm chart values.

Collection Mode

The operator supports three backends for collecting network flows. Set the mode via the collector-mode flag:

ModeFlag ValueBest ForRequirements
Netfilternetfilter (default)Most clustersLinux kernel with conntrack
eBPFebpfHigh-traffic nodesKernel BTF support
CiliumciliumCilium CNI clustersCilium eBPF maps at /sys/fs/bpf/cilium/

All three modes produce identical output. Choose based on your cluster's CNI and kernel capabilities.

If your cluster uses Cilium as its CNI, use cilium mode to avoid duplicate eBPF instrumentation and leverage Cilium's existing flow data.

Command-Line Flags

FlagDefaultDescription
-metrics-bind-address:8081HTTP server listen address for health and metrics endpoints
-read-interval5sHow often to read the conntrack/eBPF flow table
-cleanup-interval60sHow often to clean up stale flow entries
-collector-modenetfilterCollection backend: netfilter, ebpf, or cilium
-standalonefalseDisable Kubernetes connection (development/testing only)
-metrics-kubeconfig(auto)Path to kubeconfig file; auto-discovered from in-cluster config if empty

Environment Variables

VariableRequiredDescription
NODE_NAMEYesCurrent node name (auto-injected via Kubernetes downward API)
DAKR_URLYesControl plane endpoint (e.g., https://dakr.devzero.io)
CLUSTER_TOKENYesAuthentication token for the DevZero control plane
CLUSTER_IDYesCluster identifier used in health reports
FLUSH_INTERVALNoHow often to flush metrics to the control plane (default: 60s)

Data Collection Intervals

The operator runs three periodic loops:

LoopDefault IntervalWhat It Does
Collect5sReads the flow table, calculates deltas from cached entries, enriches with pod metadata
Cleanup60sRemoves stale entries for pods that no longer exist
Flush60sSends accumulated delta metrics to the DevZero control plane and resets counters

The collect interval controls granularity — shorter intervals catch short-lived connections but increase CPU usage. The flush interval controls how often data reaches the platform for cost calculation.

Helm Chart Values

image:
  repository: devzeroinc/zxporter-netmon
  tag: "v0.0.65"

config:
  collectorMode: "netfilter"   # or "ebpf", "cilium"
  exportInterval: "60s"
  dakrUrl: ""                  # Required: control plane URL
  clusterToken: ""             # Required: cluster auth token

resources:
  requests:
    cpu: 50m
    memory: 64Mi
  limits:
    cpu: 100m
    memory: 128Mi

Security Context

The operator requires elevated privileges to access the kernel's network flow data:

securityContext:
  privileged: true
  capabilities:
    add:
      - NET_ADMIN       # conntrack table and eBPF access
      - SYS_RESOURCE    # eBPF memory locking

hostNetwork: true                    # required to see node-level flows
dnsPolicy: ClusterFirstWithHostNet   # resolve cluster DNS over host network

The operator requires hostNetwork: true and privileged: true to access node-level conntrack entries and attach eBPF programs. These are standard requirements for network monitoring DaemonSets.

Resource Tuning

The default resource requests (50m CPU, 64Mi memory) are sized for clusters with moderate traffic. For high-traffic nodes (>10,000 active connections), consider increasing limits:

resources:
  requests:
    cpu: 100m
    memory: 128Mi
  limits:
    cpu: 200m
    memory: 256Mi

Monitor the operator's own resource usage via:

kubectl top pods -n devzero-zxporter -l app=zxporter-netmon

On this page