Skip to content

Limits ​

This page lists all hard limits in Kloak. Most are imposed by eBPF program constraints (verifier complexity, map sizes, stack/memory budgets) and cannot be changed without recompiling the eBPF programs. Secret value limits are also enforced at admission time by the validating webhook.

The controller runs as a DaemonSet -- one pod per node -- so all BPF map limits are per node. Per-call limits apply to individual TLS writes (SSL_write or Go crypto/tls.(*Conn).Write) or DNS packets.

Secret Limits ​

LimitValueScopeConstantDescription
Min secret value length8 bytesPer secret valueSECRET_KEY_LEN / minDataLenShorter values are rejected by the validating webhook. Without the webhook, the key is left out of the shadow (the Secret's other keys are still shadowed), so pods get no value for it.
Max secret value length128 bytesPer secret valueSECRET_MAX_LEN / maxDataLenLonger values are rejected by the validating webhook. If the webhook is not installed they are truncated, producing an incorrect rewrite.
HPACK Huffman feasibility--Per secret valueCanShadowThe value's HPACK Huffman bit density must be achievable by a same-length kl:: placeholder. Values that can't be matched are rejected ("use a different value or a longer secret").
Max secrets per TLS write4Per TLS writeXOR_MAX_MATCHESMaximum number of kl:: placeholders rewritten in a single TLS write. Additional placeholders are sent unmodified.
Max secret map entries4096Per nodesecret_map max entriesEach secret value uses two entries (plaintext plus its HTTP/2 HPACK Huffman form), so about 2048 secret values per node.
Max secret bindings65536Per nodesecret_acl max entries(container, placeholder) pairs allowed to be rewritten. Each container is bound to every key of every secret its pod references, in plaintext and HPACK Huffman form.
Placeholder key length8 bytesPer secretSECRET_KEY_LENBPF map lookup key size (kl:: + 4 characters). The first 8 bytes of each placeholder must be unique; the controller regenerates on collision.

Protocol Limits ​

LimitValueScopeDescription
Cipher suitesAES-128-GCM, AES-256-GCMPer connectionOnly AES-GCM suites (TLS 1.2 and 1.3) are rewritten. Connections using ChaCha20-Poly1305 or other suites send the placeholder.
Destination address familyIPv4 and IPv6Per connectionA secret restricted to a hostname is only rewritten over IPv6 when an IPv6 virtual IP range is configured (it is by default).

Host Filtering Limits ​

LimitValueScopeConstantDescription
Max hostname length63 charactersPer hostnamemaxHostLen (MAX_HOST_LEN = 64)Longer hostnames are rejected by the validating webhook. Without the webhook, the secret is skipped and never rewritten.
Hosts per secret1Per secretallowed_host fieldgetkloak.io/hosts takes a single hostname, IP, or *. A comma-separated value is rejected by the validating webhook (#102).
Max hosts with a virtual IP1024Per nodevip_host_ip max entriesUnique hostnames across all getkloak.io/hosts annotations.
Max virtual IP reservations4096Per nodevip_ip_host max entriesVirtual IPs of current hosts, IPv4 and IPv6, plus those of removed hosts that are still reserved.
Virtual IP range sizeIPv4 /19 or larger, IPv6 /115 or largerPer cluster--virtual-ip-rangeSmaller ranges are refused at startup.
Real addresses per virtual IP4Per virtual IPVIP_UPSTREAM_SLOTSAddresses kept from the DNS answer; a connect to the virtual IP goes to one of them at random.
Max rewritten (pod, host) pairs16384Per nodevip_pod_host max entriesPods whose DNS answers for a host are rewritten: one pair per pod IP and host of a secret it references.
Max address records per DNS answer8Per DNS responseDNS_MAX_ADDR_RECORDSAn answer with more A or AAAA records is left unchanged.
Max DNS message size512 bytesPer DNS responseMAX_DNS_PKTLarger answers, and answers over TCP, are left unchanged.
Max trusted DNS servers32Per nodetrusted_dns_servers max entrieskube-dns's ClusterIPs and endpoint addresses plus controller.dns.trustedServers.

An answer left unchanged carries the host's real addresses, so connections made with them get no host-restricted secret.

Connection Tracking Limits ​

LimitValueScopeConstantDescription
Max tracked connections16384Per nodeconn_ip_map max entriesLRU cache of the TCP connections processes made (fd → destination).
Max sockets with a host65536Per nodevip_sock_host max entriesLRU cache of sockets that connected through a virtual IP. A socket whose entry was evicted gets no host-restricted secret.
Max socket destinations65536Per nodevip_sock_dst max entriesLRU cache of the address and port each TCP socket connected to.
Max SNI entries65536Per nodesni_state max entriesLRU cache of each connection's SNI. A connection whose entry was evicted gets no host-restricted secret.

Process and Container Limits ​

LimitValueScopeConstantDescription
Max tracked processes16384Per nodetracked_tgids max entriesContainer processes seen by the exec tracepoint.
Max tracked containers4096Per nodetracked_cgroups max entriesContainers with eBPF enabled.

TLS Connection Limits ​

LimitValueScopeConstantDescription
Max TLS connection state entries4096Per nodetls_conn_state max entriesPer-connection GHASH H key cache. LRU eviction when full.
Max pending XOR patches4096Per nodexor_pending max entriesPending ciphertext patches between uprobe and kprobe.
Max patches per TLS write4Per TLS writeXOR_MAX_PATCHESCiphertext patches carried from the uprobe to the tc program for one TLS write.

Observability Limits ​

LimitValueScopeConstantDescription
Violation events ring buffer64 KBPer nodesecret_binding_events max entriesSecret binding and SNI violations reported to the controller. When full, events are dropped (the rewrite decision is not affected).
Process events ring buffer64 KBPer nodeproc_events max entriesRing buffer for exec/exit events.

Released under the GNU AGPL-3.0 License.