kudurru on Kubernetes with Helm
Two charts (dev-docs/design-record.md §5.1, §5.2, §5.7). Minimum Kubernetes 1.30.
kudurru-crds: thekudurru.ioCRDs, separate sohelm uninstallnever deletes them (generated bymake manifestsfromapi/v1alpha1).kudurru: the server. Every value maps onto a settings key of the binary (kudurru config schema), aKUDURRU_*variable or a Kubernetes field;deploy/chart_test.gorenders every values permutation, loads each renderedkudurru.yamlthrough the binary's own config loader and validates the manifests with kubeconform (make helm-check).
Install
kubectl create namespace kudurru-system
kubectl label namespace kudurru-system pod-security.kubernetes.io/enforce=restricted
helm install kudurru-crds oci://ghcr.io/robertherbaugh/charts/kudurru-crds --version 0.2.0
helm install kudurru oci://ghcr.io/robertherbaugh/charts/kudurru --version 0.2.0 \
--namespace kudurru-system --set replicaCount=1
This command starts one replica without a license key. The chart defaults
to mode: kubernetes with two replicas of a Deployment storing
objects as CRDs (kube driver), a Lease-elected controller, one
mixed-protocol LoadBalancer Service on :53 with
externalTrafficPolicy: Local (client addresses are the product), a PDB,
topology spread, dnsPolicy: Default and the Restricted Pod Security
Standard (uid 65532, read-only root, all capabilities dropped except
NET_BIND_SERVICE, net.ipv4.ip_unprivileged_port_start=0 so the
non-root process binds :53).
Two replicas need a license key. Without one kudurru runs as one node, so
a default install (two replicas) is over the node limit: DNS answers as usual,
but changes through the API and the dashboard answer 402 license_required
until you add a key (a free personal key covers 3 nodes) or set
replicaCount=1. Changes with kubectl are not affected. See
License key.
AuditLog trust
When using the Kubernetes AuditLog store (audit.store: auto without a central
database, or audit.store: auditlog), provision the independent
kudurru-audit-keys Secret in the release namespace using the
AuditLog key runbook.
Helm does not generate or rotate this trust root. Without it, DNS starts and
local audit spooling continues, but cluster audit shipping and verification are
unavailable. Existing installations must follow the legacy-cutover procedure
before upgrading; session encryption keys no longer determine new audit seals.
Upgrading from 0.1.x
An installation of 0.1.x is upgraded offline when it holds private IAM
Secrets (it almost always does: 0.1.0 creates the break-glass account):
upgrade kudurru-crds, run the Kubernetes IAM upgrade,
provision the AuditLog trust above, then upgrade this chart. The ordered list
is Upgrading from 0.1.x.
First login
The chart generates three Secrets once and keeps them on uninstall
(helm.sh/resource-policy: keep): <release>-encryption-key,
<release>-admin and, with edge.enabled, <release>-proxy-protocol. The
release notes print the commands; in short:
kubectl -n kudurru-system get secret kudurru-admin -o jsonpath='{.data.password}' | base64 -d; echo
kubectl -n kudurru-system port-forward svc/kudurru-api 8080:8080
# open https://localhost:8080/ and sign in as admin
The admin Secret is read only while no user exists; the UI asks for a new
password at the first login. Point auth.bootstrapAdminSecret and
auth.encryptionKeySecret at your own Secrets (for example from
external-secrets) to keep secret material out of Helm entirely.
License key
kudurru is source-available under the Kudurru Community License
(see LICENSING.md). Without a key one node runs with
the community limits: DNS, blocking, zones and the dashboard work, but
OIDC sign-in, the dnsdist and keepalived edge and the
integrations (the ee/ features) are off, and a cluster of more than one
node cannot change its configuration through the API. Without a key the API
allows one policy, the seeded default. A free personal key (3 nodes,
eligible community use) or a business key lifts these limits. Put the key in a Secret
and name it, so the key stays out of values files:
kubectl -n kudurru-system create secret generic kudurru-license --from-file=license.key=./license.key
helm upgrade kudurru ... --set license.existingSecret=kudurru-license
license.key takes the key as a string and creates the Secret for you. Every
kudurru container (the server, the dnsdist supervisor and the keepalived
supervisor) reads it as KUDURRU_LICENSE_KEY; the Secret is optional, so pods
start without it. With edge.enabled the supervisors refuse a first start without
a key that covers the edge feature. kudurru license status and
GET /api/v1/license show the state; the Secret is reread every minute.
Shapes
| Goal | Values |
|---|---|
| Default: replicas behind a cloud or MetalLB LoadBalancer | (none) |
| Pin the address with MetalLB | vip.provider=metallb, vip.address=192.0.2.53 (vip.metallbPool) |
| Pin the address with kube-vip | vip.provider=kube-vip, vip.address=192.0.2.53 |
| LoadBalancer without mixed-protocol support | service.dns.splitProtocols=true (dns-udp + dns-tcp sharing the IP) |
| One pod per node on the host network | hostNetwork.enabled=true (DaemonSet, the -hostnetwork image) |
| Single node, no CRDs ("Pi-hole on k3s") | mode=standalone (sqlite on a PVC, StatefulSet with one replica) |
| dnsdist edge in front (DoT/DoH/DoQ, packet cache) | edge.enabled=true (edge.mode=deployment) |
| Single-node cluster with dnsdist | edge.enabled=true, edge.mode=sidecar |
| Bare-metal VIP with keepalived | edge.enabled=true, vip.provider=keepalived, vip.address=10.0.0.53/24, vip.keepalived.interface=eth0 |
| DNS before the control plane | priorityClassName=system-cluster-critical, persistence.local.enabled=true |
| DHCPv4 for relayed clients (DHCPv4) | dhcp.enabled=true, dhcp.serverAddress=10.200.200.67 |
Dashboard sticky sessions with Traefik
The chart can create a Traefik IngressRoute with cookie affinity:
ingress:
enabled: true
kind: IngressRoute
host: kudurru.example.com
traefik:
entryPoints: [websecure, dmz-websecure]
tls: {} # Traefik's default certificate
Traefik and its traefik.io CRDs must already be installed. The generated
route targets the API Service's port and sets nativeLB: false so Traefik
chooses a pod directly. Cookie affinity is enabled by default and emits:
sticky:
cookie:
name: kudurru_instance
secure: true
httpOnly: true
sameSite: lax
Override these settings under ingress.traefik.sticky.cookie, or set
ingress.traefik.sticky.enabled: false to disable affinity. The cookie
keeps dashboard requests on one replica while it is available, making
node-local views such as query logs consistent between requests. Session
authentication still works across replicas through the shared encryption
key. Traefik can select another replica when the current one is unavailable.
ingress.traefik.tls accepts Traefik's TLS settings, for example
{secretName: dns-tls}. ingress.tls remains the list used by standard
Kubernetes Ingress resources. ingress.className, when set for an
IngressRoute, becomes its kubernetes.io/ingress.class annotation. When
migrating a separately managed IngressRoute into the chart, remove its
previous definition or adopt it into Helm before upgrading; Helm cannot
claim a resource owned by another manager automatically.
For a standard HTTPS Ingress with ingress.className: traefik, the chart
automatically puts the same sticky-cookie settings on the API Service as
Traefik annotations. Explicit service.api.annotations override the
generated defaults. Other ingress controllers can still use the existing
annotation values to configure their own affinity.
For clients reaching the Kubernetes API/UI Service directly, set
service.api.sessionAffinity: ClientIP and optionally
service.api.sessionAffinityConfig.clientIP.timeoutSeconds (1-86400;
default 10800). Service affinity defaults to None. Traefik's direct pod
routing uses the cookie settings above and bypasses Service affinity.
mode=standalone
store.driver: sqlite, a StatefulSet with one replica and a
volumeClaimTemplate for /var/lib/kudurru (persistence.standalone). No
ClusterRole, no ServiceAccount token, no CRDs: objects come from
objects: in the values (written into the node file as file-managed
objects) and from the UI.
Persistence in mode=kubernetes
querylog.db and local.db live in /var/lib/kudurru. By default that is
an emptyDir (it survives container restarts and node reboots while the
pod stays). persistence.querylog.enabled or persistence.local.enabled
switch the Deployment to a StatefulSet so every replica gets its own claim
(SQLite WAL files must never be shared or put on RWX/NFS). A hostNetwork
DaemonSet cannot have per-pod claims; use extraVolumes with a hostPath
there.
For independent querylog.db and local.db mounts, opt into
persistence.querylog.separate / persistence.local.separate. Existing
enabled values keep their shared data claim behavior. See
separate SQLite storage for claim combinations and the
required offline migration; changing StatefulSet claim templates is not a
rolling file move.
Audit log
Events are always recorded and shipped; reading them (the Audit tab,
GET /api/v1/audit, kudurru audit) needs a license key that includes the
audit trail, and answers 402 license_required without one.
In mode=kubernetes every replica records the changes it makes in its own
audit spool (audit-spool.db) and copies them into AuditLog objects
(audit.kudurru.io) in the release namespace. Every replica reads all of
them, so the Audit tab, GET /api/v1/audit and kudurru audit give the
same answer whichever replica serves them, and the events survive pod
replacement. Install or upgrade the kudurru-crds chart first: without the
AuditLog CRD each replica shows only its own events and logs a warning.
The leader deletes batches older than audit.retention (400 days). The
ServiceAccount may create and delete AuditLogs but not update them; every
batch is hash-chained and sealed with the encryption key, and every event
is also a "log":"audit" line for your log pipeline. audit.store: local
keeps the events on each replica only. With a central database
(database.dsn, postgres.md) the events go there instead.
Central database
database.existingSecret names a Secret in the release namespace whose key
database.dsnKey (default uri, what a CloudNativePG <cluster>-app
Secret holds) is a PostgreSQL 16+ connection string. Every replica then
keeps the audit log, query log and statistics of all replicas there, and
the dashboard's All nodes view reads them (postgres.md).
The chart does not install PostgreSQL. A CloudNativePG cluster is enough:
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata: {name: kudurru-db, namespace: kudurru-system}
spec:
instances: 2
storage: {size: 20Gi}
bootstrap: {initdb: {database: kudurru, owner: kudurru}}
helm upgrade kudurru oci://ghcr.io/robertherbaugh/charts/kudurru \
--set database.existingSecret=kudurru-db-app \
--set database.clusterDNS=true \
--set-json 'config.settings.database={"querylog":{"retention":{"raw":"168h"}}}'
The pods use dnsPolicy: Default, the node's resolver, because kudurru can
be the cluster's own resolver. A cluster Service name such as the
kudurru-db-rw.kudurru-system of a CloudNativePG uri therefore does not
resolve from them ("hostname resolving error" in the logs). Put the
Service's ClusterIP or an external name that the node resolves in the
connection string (a Secret of your own with the key uri), or set
database.clusterDNS=true: the pods then use dnsPolicy: ClusterFirst, and
the kudurru-db-app Secret works as it is. Do not set it when kudurru is
what resolves the cluster's names (the pods would resolve through
themselves). With hostNetwork.enabled cluster names already resolve.
DNS never waits for the database. When it is unreachable, each replica
keeps its data and sends it later, and the KudurruCentralDatabaseDown
alert fires.
hostNetwork
hostNetwork.enabled runs a DaemonSet in the host network namespace, where
the namespaced net.ipv4.ip_unprivileged_port_start sysctl is not available
(Kubernetes rejects net.* sysctls on hostNetwork pods) and Kubernetes gives
a non-root process no ambient capabilities. The chart therefore runs
ghcr.io/robertherbaugh/kudurru:<version>-hostnetwork
(hostNetwork.imageTagSuffix): the same binary with the file capability
cap_net_bind_service=+ep (images/hostnetwork/Dockerfile). The container
keeps the Restricted security context: uid 65532, all capabilities dropped
except NET_BIND_SERVICE, allowPrivilegeEscalation: false.
NET_BIND_SERVICE must stay in securityContext.capabilities.add: the
kernel refuses to start a binary whose file capability is outside the
bounding set, so the chart fails the render without it. Host networking is
outside the Baseline level; label the namespace
pod-security.kubernetes.io/enforce=privileged. With your own image set
hostNetwork.imageTagSuffix: "" and either give the binary the capability
or set net.ipv4.ip_unprivileged_port_start=53 on the hosts.
Edge (dnsdist)
The dnsdist and keepalived supervisors need a license key that includes the edge; without one a first start is refused, and an expired key never stops a restart (see License key).
With edge.enabled the dns Service selects the edge pods; kudurru listens
on edge.backendPort (5353) and accepts PROXYv2 only from
edge.proxyProtocolFrom with the TLV 0xE0 secret from
<release>-proxy-protocol (D72). The CIDR defaults to the RFC 1918 and ULA
ranges; narrow it to your pod CIDR. The supervisor reads the headless
Service's EndpointSlices (--backends-from endpointslice:<ns>/<release>-headless) and exposes readiness and
/metrics on :8084.
Dnsdist uses a LOCAL PROXYv2 header for backend health checks. Kudurru accepts LOCAL from listed peers and keeps the transport peer as the client. LOCAL cannot delegate an identity. Normal PROXYv2 queries still need the TLV 0xE0 secret before Kudurru uses an advertised client address.
The dnsdist container runs as uid 953 under the Restricted standard, and
binds :53 through the pod's ip_unprivileged_port_start sysctl. Two cases
need more than Kubernetes gives a non-root process, because added
capabilities are only effective for root: edge.ebpf.enabled (creating
the BPF maps needs CAP_BPF/CAP_SYS_ADMIN) and dnsdist on the host
network (edge.mode=daemonset, vip.provider=keepalived, or the sidecar of
a hostNetwork.enabled pod), where the sysctl is not available. There the
container starts as root with group 953, allowPrivilegeEscalation: false,
a read-only root and every capability dropped except NET_BIND_SERVICE,
SETUID, SETGID and KILL (plus BPF and SYS_ADMIN for eBPF); the
supervisor passes --dnsdist-user=953:953, so dnsdist binds its sockets
and creates the maps as root, then switches to 953 and keeps only
CAP_SYS_ADMIN (eBPF) or nothing. make edge-check runs both cases in the
image. Such a namespace needs the privileged level (SYS_ADMIN and host
networking are outside Baseline).
vip.provider=keepalived runs dnsdist and keepalived in one hostNetwork
DaemonSet on the nodes labelled kudurru.io/vip=true. keepalived needs
NET_ADMIN, NET_RAW and NET_BROADCAST as root, plus SETUID and
SETGID to run its existing health scripts as UID/GID 953. All other
capabilities remain dropped. Label the namespace
pod-security.kubernetes.io/enforce=privileged.
For two VIPs with separate VRRP and address interfaces:
edge:
enabled: true
vip:
provider: keepalived
keepalived:
interface: eth1 # virtual addresses
vrrpInterface: eth0 # advertisements and unicast source discovery
vips:
- {name: dns-a, address: 192.0.2.53/24, vrid: 53}
- {name: dns-b, address: 192.0.2.54/24, vrid: 54}
The list replaces vip.address and vip.keepalived.vrid; each entry may
override interface and set preemptDelay (0-1000 seconds). Names, VRIDs,
and addresses must be unique, even when prefix lengths differ. VIPs
and unicast peers must use the same address family. The first VIP prefers
the first node by name; the second reverses priorities, allowing
active/active ownership. By default nopreempt keeps
ownership stable after recovery; use kudurru vip rebalance or an entry's
preemptDelay to restore the preferred owner. Leaving vrrpInterface
empty preserves the existing behavior: VRRP uses each VIP's interface.
Peer discovery still uses Kubernetes Node InternalIPs, which must be
reachable through the VRRP interface.
Helm compares address text without the prefix length; it does not
canonicalize IPv6. Write IPv6 addresses consistently in lowercase,
compressed notation so Helm can detect duplicates. Equivalent spellings
such as 2001:db8::1/64 and 2001:DB8:0::1/128 can pass helm template,
but the supervisor compares parsed IP addresses and refuses them before
starting keepalived. This also covers IPv4-embedded IPv6 spellings such as
::ffff:192.0.2.1 and ::ffff:c000:201. A successful Helm render alone
does not prove IPv6 address uniqueness.
For an unnumbered VIP interface, select a numbered VRRP interface carrying the Node InternalIP. Allow IP protocol 112 between the selected nodes on that interface. Keepalived tracks each VIP interface as well as the VRRP interface, so loss of either link puts its instance into FAULT and withdraws the address. Gratuitous ARP stays on the VIP's interface. Before migration, withdraw each address from MetalLB or kube-vip; only one provider may advertise an address at a time.
For explicit keys per VRID, use vip.keepalived.hmacKeySecrets with one
{vrid, secretName, key} reference for every VIP. The empty list keeps the
existing shared key; partial or mixed shared/per-VRID choices refuse render.
See VRRP HMAC key files for private mounts, limits and the
required coordinated restart procedure for migration and rotation.
The Nodes page's Edge panel polls supervisor readiness, backend health,
and each node's VIP states every ten seconds. Separate edge workloads
publish a headless <release>-edge-status Service; the API discovers all
its EndpointSlices, including unready pods, and polls their health
listeners on 8084/8085. Failures remain visible as unavailable or degraded.
The sidecar uses its local listener. With standalone mode and a separate
edge, the chart grants the server read access to EndpointSlices in the
release namespace and mounts its ServiceAccount token. If rbac.create
is false, supply that permission yourself.
Encrypted transports
service.dot|doh|doq|doh3.enabled add the ports to the dns Service. Without
the edge kudurru terminates TLS with the kubernetes.io/tls Secret named by
tls.secretName; with the edge dnsdist terminates it with
edge.tlsSecretName.
DHCPv4
In mode: kubernetes, dhcp.enabled=true with dhcp.serverAddress (the
LoadBalancer address the router's DHCP relay sends to) serves the
DHCPScope objects from one replica, the holder of the kudurru-dhcp
Lease, and keeps leases as DHCPLease objects. Upgrade the kudurru-crds
chart of the release first; it adds both CRDs. The chart also installs a
cluster-scoped ValidatingAdmissionPolicy that limits the pod-label patches of
kudurru's ServiceAccount. Follow the Kubernetes DHCP walkthrough
for router relay setup, required trusted relays and client verification.
For scopes from Git, use the Kubernetes DHCP reference. In
mode: standalone, configure DHCP with config.node.dhcp as on any SQLite
node.
Configuration
config.node (node keys: listeners, store, log, tsigKeys, notify) and
config.settings (cluster keys: upstreams, cache, blocking, querylog,
ratelimit) are YAML in the format of kudurru.yaml
(dev-docs/design-record.md §6.2):
config:
node:
log: { level: info, format: json }
settings:
upstreams:
groups:
default: { servers: ["tls://1.1.1.1", "tls://9.9.9.9"], strategy: parallel_best, timeout: 2s }
# default: { mode: recursive } # resolve from the root servers and validate DNSSEC instead
conditional: { "corp.example.": internal }
blocking: { defaultResponse: nxdomain }
They render into two ConfigMaps (D25): <release>-node is the file
serve --config reads and its checksum annotation rolls the pods;
<release>-settings holds the cluster keys and is mounted at
/etc/kudurru/settings for hot reload through KUDURRU_SETTINGS_FILE.
The binary reads and watches that settings file. The chart also merges
the settings into the node file, so Helm settings changes roll the pods
through its checksum annotation. Direct edits to the mounted settings
ConfigMap reload hot keys without a restart. Cluster settings default to GitOps ownership. For upstreams, choose
Adopt into UI management on DNS > Upstreams to persist the entire
section in <release>-ui-settings, an API-owned ConfigMap that Helm never
renders. config.uiSettingsResource optionally selects its name; keep that
name stable after adoption. Existing release-namespace ConfigMap RBAC already
allows the required get/create/update operations; no CRD change is needed.
UI-owned upstreams survive Helm upgrades and propagate to every replica on
the settings poll (up to ten seconds). If Helm still declares upstream keys,
the API reports conflicts: [upstreams], logs a warning and keeps UI values.
Set config.settings.upstreams: null to remove the chart's upstream defaults
while UI ownership is active. Do not put ownership in Helm values: ownership
changes require the explicit API/dashboard adoption or release flow.
To return to GitOps, export the current Helm values, commit and apply them, wait for the settings volume to update on every replica, refresh the ownership revision, then release. The API requires the serving replica's effective file configuration to match the UI values before handoff; it does not check the mounted volumes on other replicas. Upstream environment overrides block ownership transitions. Back up the API-owned ConfigMap separately from ordinary object-store exports and keep the node data directory for offline startup state. See configuration and the store.
Seed objects with objects: (post-install hook resources in
mode=kubernetes: created once, then owned by kubectl and the UI).
Default object namespace and upgrades
On a fresh mode=kubernetes install, the bootstrap creates ClientGroup default, Policy default and BlockList starter in the release namespace.
The policy fallback, API writes without a namespace, dashboard allow/deny
lists and block-page unblock requests use that namespace too. The root
DNSZone is cluster-scoped. mode=standalone and Docker keep default.
The CLI has its own namespace setting for commands that name resources:
use -n <release-namespace> or set
--default-namespace <release-namespace> when logging in. Namespace fields
in dashboard object creation forms are explicit choices; set them to the
release namespace.
Earlier Kubernetes installs created these objects in default. At startup,
if Policy default exists in default and no Policy default exists in the
release namespace, kudurru keeps default for those defaults and logs a
warning. It does not move, recreate or overwrite existing objects; operator
edits and policy/list references stay intact. Identity Secrets, Leases and
audit batches continue to use the release namespace.
To move an existing install, copy the desired ClientGroups, BlockLists and
Policies into the release namespace, preserving their names and references
and including Policy default. Remove server-assigned metadata such as
uid, resourceVersion, creationTimestamp and managedFields from the
copies. Restart all replicas after the copies exist: a Policy default in
the release namespace takes precedence. Verify blocking and API writes
before removing the old resources. Default selection is made at startup,
so keep both sets during the rollout.
Monitoring
| Value | Renders |
|---|---|
serviceMonitor.enabled | ServiceMonitor on the API Service's metrics port (adds a pod label) |
podMonitor.enabled | PodMonitor on every kudurru pod |
either, with edge.enabled | PodMonitor <release>-edge on the supervisors: kudurru edge run :8084 (edge-ready) and, with vip.provider=keepalived, kudurru vip run :8085 (vip-health); labels and interval from podMonitor when enabled, else serviceMonitor |
prometheusRule.enabled | PrometheusRule from deploy/prometheus/rules.yaml |
grafanaDashboard.enabled | ConfigMap with deploy/grafana/kudurru-overview.json, label grafana_dashboard: "1" for the Grafana sidecar |
The dashboard has the §11.6 rows (tiles, traffic, latency heatmap,
blocking, cache, upstreams, zones, pipeline and query log, cluster and
store, dnsdist, VIP); every query uses a metric the binary registers today
(the deploy tests enforce it), including the serial-divergence panel and
KudurruSerialDivergence. The edge and VIP panels and the
KudurruEdgeBackendDown and KudurruVIPNoMaster alerts read the
supervisors' metrics listeners (:8084, :8085), which the <release>-edge
PodMonitor scrapes (a node label names the node of hostNetwork pods).
On the Kubernetes store, kubectl describe dnszone <name> shows controller
Events such as SerialBumped. Cluster-scoped DNSZone Events are stored in
default; namespaced DNSRecordSet Events are stored in the object's
namespace. The leader also logs the same transitions. If
kudurru_controller_events_dropped_total increases, check its reason label:
queue_full means the API writer could not keep up, write_failed means the
API write failed (see the warning log), and invalid_event means the Event
could not be built. Delivery is best effort and never waits in a reconcile.
Network policy
networkPolicy.enabled restricts ingress to the kudurru pods: :5353 only
from edge pods (plus edge.proxyProtocolFrom as ipBlocks in the
hostNetwork daemonset mode), the internal listener :8082 only from kudurru
and edge pods, the API from networkPolicy.apiFrom (default: everyone),
metrics from networkPolicy.metricsFrom, probes on :8081, and with
blockPage.enabled the block page ports from everyone. Egress is not
restricted. If your cluster restricts egress with its own policies (a
default-deny NetworkPolicy, a CNI egress gateway or firewall), allow the
kudurru pods UDP and TCP 53 to the upstream servers, or to any address
(0.0.0.0/0 and ::/0) when an upstream group is recursive
(mode: recursive).
Block page
blockPage.enabled with blockPage.ipv4 (or ipv6) serves the block page
on the kudurru pods behind a <release>-blockpage Service (LoadBalancer by
default, ports 80 and optionally 443) and sets blockPage.enabled/ipv4/ipv6
in the settings ConfigMap; pick the blockPage response with
config.settings.blocking.defaultResponse or per Policy. Setup, the HTTPS
caveats and the edge and caching notes: blocking-page.md.
RBAC
The kudurru ServiceAccount gets (D77, §5.3): create/patch/delete/get/list/
watch on the five kudurru.io kinds, update/patch on their status,
read-only dnsendpoints, services, namespaces and endpointslices,
create on events, tokenreviews and subjectaccessreviews; in the release
namespace only, leases (get/create/update), secrets
(get/list/watch/create/update/patch/delete: token revocation and user or
RoleBinding deletion delete Secrets) and configmaps
(get/list/watch/create/update). rbac.aggregateToDefaultRoles adds
<release>-viewer|editor|admin aggregated into view|edit|admin and
<release>-auditor (aggregated nowhere: it reads the query log). They are
generated from internal/rbac/permissions.yaml by make rbac-manifests
into templates/rbac-aggregated.yaml.
Impersonation (auth.kubernetes.mode)
auth.kubernetes.mode: sar (the default) authorizes Kubernetes
ServiceAccount tokens with SubjectAccessReview and writes every object as the
kudurru ServiceAccount. auth.kubernetes.mode: impersonate (D386) keeps that
authorization and additionally sends each API write of a kudurru.io object
as the signed-in principal, so Kubernetes RBAC decides it too and the apiserver
audit log records the principal as impersonatedUser:
| Principal | Kubernetes name |
|---|---|
| Kubernetes ServiceAccount | system:serviceaccount:<namespace>:<name> with its token's groups |
| Local user | kudurru:user:<name>, groups kudurru:group:<group> |
| OIDC user with a bearer JWT | kudurru:user:<idp>:<name>, groups kudurru:group:<idp>:<group> from the token |
| OIDC user on a dashboard session or personal API token | kudurru:user:<idp>:<name>, no groups |
| Kudurru service account (and its tokens) | kudurru:serviceaccount:<namespace>:<name> |
Dashboard sessions and personal API tokens do not keep an OIDC user's
identity-provider groups (D48), so bind OIDC users who sign in to the
dashboard by user name; a binding to their kudurru:group: name only matches
their bearer-JWT requests. Kudurru RoleBindings, ServiceAccounts and
IdentityProviders are kudurru.io objects, so writing them through the API
needs Kubernetes RBAC on those resources too.
Only with this value does the ClusterRole gain impersonate on users,
groups and serviceaccounts. Kubernetes cannot restrict that verb to the
kudurru: names, so a compromised kudurru pod becomes cluster-admin-equivalent
(D55). Set the value in auth.kubernetes.mode, not in config.node or
config.settings (the chart refuses those, because they would enable the mode
without the grant). Before switching, bind Kubernetes RBAC to every name that
writes, for example:
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata: {name: kudurru-admin-user}
roleRef: {apiGroup: rbac.authorization.k8s.io, kind: ClusterRole, name: kudurru-admin}
subjects:
- {apiGroup: rbac.authorization.k8s.io, kind: User, name: "kudurru:user:admin"}
Server-side apply needs create and patch, and deletes need delete.
A Kubernetes refusal answers 403 forbidden with the apiserver's reason and
writes nothing. If kudurru itself lacks the impersonate verb, writes answer
503 unavailable and the server log carries the apiserver's reason.
The kustomize bases (deploy/kustomize) never grant impersonate. To use the
mode there, set auth.kubernetes.mode: impersonate in the node configuration
and add this rule to the kudurru ClusterRole yourself (same D55 caveat):
- apiGroups: [""]
resources: [users, groups, serviceaccounts]
verbs: [impersonate]
Reads, status updates, internal Secrets, the audit log and
writes without a signed-in principal (controllers, RFC 2136 UPDATE, the
external-dns webhook, integrations) stay on the kudurru ServiceAccount, and
so does the kudurru admin socket.
External zones (externalZones.enabled)
externalZones.enabled: true (D402) turns on the source adapter that fills
DNSZones of type external from Ingresses, Gateway API routes and
LoadBalancer Services (external zones).
Only with this value does the ClusterRole gain get, list and watch on
networking.k8s.io ingresses and on gateway.networking.k8s.io
gateways, httproutes, grpcroutes and tlsroutes; Services are already
readable. The adapter never writes those objects. Set the value here, not in
config.node or config.settings (the chart refuses those, because they
would enable the adapter without the grant). The Gateway API CRDs are
optional: unavailable kinds are skipped and reported on zones that enable Gateway sources.
externalZones:
enabled: true
With the kustomize bases, set externalZones.enabled: true in the node
configuration and add the two rules above to the kudurru ClusterRole.
Operational limits: each source kind is read as one complete list of at most
4,096 objects and 32 MiB (pages of 64 objects, each response at most 4 MiB).
If a page exceeds 4 MiB, the adapter restarts the list once with pages of
eight; it never uses the partial snapshot. Services are listed and watched
with spec.type=LoadBalancer where the API server supports it. If it rejects
that field selector, the adapter lists and watches all Services for that
elected term, and every Service counts toward the same caps. The adapter
only publishes LoadBalancer Services either way. One source can own record
sets in at most eight zones, with at most
1,000 endpoints per record set. A refused list does not remove last-good
record sets. An affected zone can be Ready and Degraded at the same time:
SourcesIncomplete names the source failure, while SourcesNotRead means
externalZones.enabled is off. See the
runbook for metrics and recovery.
The server keeps one Secret of its own in the release namespace that the chart
does not create or remove: kudurru-grant-floors, the record of removed role
binding grants (role bindings on Kubernetes).
Values
See deploy/helm/kudurru/values.yaml; every value carries a comment. Values that
the chart added beyond §5.2: tls.secretName, edge.backendPort,
edge.proxyProtocolFrom, edge.tlsSecretName, edge.existingSecret,
edge.dnsdistVersion, vip.metallbPool, vip.keepalived.existingSecret,
vip.keepalived.keepalivedVersion, auth.encryptionKeyPreviousSecret,
auth.bootstrapToken, license.key, license.existingSecret, license.secretKey, podMonitor, probes, lameduckSeconds,
clusterDomain (default cluster.local), persistence.standalone.enabled,
extraEnv, extraVolumes, extraVolumeMounts, blockPage. auth.oidc.providers is
a list of OpenID Providers rendered into the settings key
auth.identityProviders (the §5.2 outline's single-issuer auth.oidc
became a list). webhook from the §5.2 outline is not in the chart: the
validating webhook does not exist in the binary.
OIDC usernames: without claimMappings.username.claim a provider's
username is the first of preferred_username, upn, email (only when
email_verified is true) and sub. Some identity providers let users edit
preferred_username, so a role binding with a User subject could be
claimed by another account. Bind groups instead, or set
claimMappings.username.claim: sub (with a prefix) on such providers.