cilium/cilium
Data models
The recurring data types a contributor needs to recognise. Each entry points at the canonical source file.
Identities
| Type | File | Notes |
|---|---|---|
identity.NumericIdentity |
pkg/identity/numericidentity.go |
24-bit unsigned, used as BPF map keys. |
identity.Identity |
pkg/identity/identity.go |
Numeric ID + canonical label set. |
identity.IdentityCache |
pkg/identity/cache/cache.go |
Local cache; updates flow into selector cache and ipcache. |
labels.Labels |
pkg/labels/labels.go |
Label set with canonical encoding for hashing. |
Endpoints
| Type | File | Notes |
|---|---|---|
endpoint.Endpoint |
pkg/endpoint/endpoint.go |
Per-pod state machine. |
endpoint.EndpointStatus |
pkg/endpoint/endpoint_status.go |
Status fields surfaced in cilium endpoint list. |
endpointmanager.Manager |
pkg/endpointmanager/manager.go |
Local registry of endpoints. |
| CNI request | plugins/cilium-cni/types.go |
The shape sent from kubelet → CNI → agent. |
Policy
| Type | File | Notes |
|---|---|---|
api.Rule |
pkg/policy/api/rule.go |
The CNP/CCNP rule type. |
policy.Repository |
pkg/policy/repository.go |
In-memory rule database. |
policy.SelectorPolicy |
pkg/policy/distillery.go |
Per-identity merged policy. |
policy.L4Filter |
pkg/policy/l4.go |
One (port, proto, identity, L7) entry. |
policy.PolicyMapState |
pkg/policy/policymap_state.go |
The bytes written to BPF. |
Datapath
| Type | File | Notes |
|---|---|---|
datapath.Datapath |
pkg/datapath/types/ |
Top-level interface. |
loader.Loader |
pkg/datapath/loader/loader.go |
BPF compile + attach. |
tables.Device |
pkg/datapath/tables/devices.go |
StateDB row for an observed network device. |
tables.Route |
pkg/datapath/tables/route.go |
StateDB row for a route to install. |
BPF maps (key/value pairs)
| Map | Source | Contents |
|---|---|---|
cilium_ipcache |
pkg/maps/ipcache/ipcache.go |
IP → identity mapping for every endpoint and reserved entity. |
cilium_ct4_global / cilium_ct6_global |
pkg/maps/ctmap/ctmap.go |
Conntrack tables (per family). |
cilium_nat_v4 / cilium_nat_v6 |
pkg/maps/nat/nat.go |
NAT tables. |
cilium_lb_services_v2 |
pkg/maps/lbmap/services.go |
Service VIP → service id. |
cilium_lb_backends_v3 |
pkg/maps/lbmap/backends.go |
Backend slots per service. |
cilium_policy_<id> |
pkg/maps/policymap/policymap.go |
Per-endpoint allow/deny entries. |
cilium_lxc |
pkg/maps/lxcmap/lxcmap.go |
Endpoint id → identity. |
cilium_node_map |
pkg/maps/nodemap/nodemap.go |
Node IPs → identities. |
cilium_signals |
pkg/maps/signalmap/signalmap.go |
Agent ↔ dataplane signals. |
Service / load balancer
| Type | File | Notes |
|---|---|---|
loadbalancer.Service |
pkg/loadbalancer/service.go |
Logical service. |
loadbalancer.Frontend |
pkg/loadbalancer/frontend.go |
(vip, port, proto). |
loadbalancer.Backend |
pkg/loadbalancer/frontend.go |
Reachable target. |
maglev.Table |
pkg/maglev/maglev.go |
Consistent hash table. |
CRD types
CRDs live under pkg/k8s/apis/cilium.io/v2/ and v2alpha1/. See api/crds.md for the catalog.
Hubble flow
| Type | File | Notes |
|---|---|---|
pb.Flow |
api/v1/flow/flow.proto |
The flow message. |
monitor.NotifyEvent |
pkg/monitor/datapath_notify.go |
Raw datapath event before parsing. |
| Per-class parsers | pkg/hubble/parser/threefour/, seven/, tracing/, sock/ |
Decode raw events. |
Hive cells
| Type | File | Notes |
|---|---|---|
cell.Cell, cell.Module |
vendor/github.com/cilium/hive/cell/ |
DI primitives. |
cell.Lifecycle, cell.Health |
same | Lifecycle hooks and health reporting. |
statedb.DB, statedb.Table[T] |
vendor/github.com/cilium/statedb/ |
Transactional tables. |
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.