DHCPScope

DHCPScope is a DHCPv4 address pool served by kudurru in Kubernetes.

DHCPScope is a DHCPv4 address pool served by kudurru in Kubernetes. Leases are DHCPLease objects (dhcp.kudurru.io); one replica allocates at a time.

API versionkudurru.io/v1alpha1
KindDHCPScope
ScopeCluster
Resourcedhcpscopes.kudurru.io
Short namesdhcpscope
Subresourcesstatus

Columns of kubectl get dhcpscopes:

ColumnTypeValue
SUBNETstring.spec.subnet
LEASESinteger.status.activeLeases
SERVINGstring.status.servingPod
READYstring.status.conditions[?(@.type=="Ready")].status
AGEdate.metadata.creationTimestamp

Spec

DHCPScopeSpec is one DHCPv4 address pool and the options its clients receive. Clients reach kudurru through the trusted relays; the server address clients see is a node setting (dhcp.serverIP), shared by every scope.

FieldTypeDescription
spec.bootFilestringLength: at most 128
spec.bootProfiles[]objectItems: at most 32
spec.bootProfiles[].architectureintegerRequired.
Format: int32
Range: 0 to 65535
spec.bootProfiles[].bootFilestringLength: at most 128
spec.bootProfiles[].bootServerstringLength: at most 15
spec.bootProfiles[].bootServerNamestringLength: at most 64
spec.bootServerstringLength: at most 15
spec.bootServerNamestringLength: at most 64
spec.classlessRoutes[]objectItems: at most 32
spec.classlessRoutes[].destinationstringRequired.
Length: at most 18
spec.classlessRoutes[].routerstringRequired.
Length: at most 15
spec.conflictDetectionstringConflictDetection probes a new address before offering it: icmp (default; needs NET_RAW) or disabled.
One of: auto, icmp, disabled
spec.dnsServers[]stringRequired. DNSServers are the IPv4 DNS servers advertised to clients.
Items: 1 to 63
spec.dnsTTLstringDNSTTL is the TTL of those records, from 1s to 1h, clamped to the remaining lease time.
Default: 30s
spec.domainNamestringDomainName is the client domain, also the domain of local DNS records when registerDNS is set.
Length: at most 253
spec.domainSearch[]stringItems: at most 32
spec.leaseDurationstringLeaseDuration is in whole seconds, from one minute to 30 days.
Default: 12h
spec.ntpServers[]stringItems: at most 63
spec.probeTimeoutstringProbeTimeout bounds the ICMP probe; default 200ms.
spec.rangeEndstringRequired.
Length: at most 15
spec.rangeStartstringRequired. RangeStart and RangeEnd bound the dynamic pool, inclusive.
Length: at most 15
spec.registerDNSbooleanRegisterDNS publishes A and PTR records for bound leases on every replica.
spec.reservations[]objectReservations assign fixed addresses to MAC addresses.
Items: at most 4096
spec.reservations[].hostnamestringLength: at most 253
spec.reservations[].ipstringRequired.
Length: at most 15
spec.reservations[].macstringRequired.
Length: at most 17
spec.routerstringRequired. Router is the default gateway advertised to clients.
Length: at most 15
spec.subnetstringRequired. Subnet is the client IPv4 subnet in canonical CIDR form; it must not overlap another scope.
Length: at most 18
spec.trustedRelays[]objectRequired. TrustedRelays are the relays allowed to forward this subnet's clients. At least one is required.
Items: 1 to 64
spec.trustedRelays[].gatewayIPstringRequired. GatewayIP is the giaddr the relay writes for this subnet; it is never allocated.
Length: at most 15
spec.trustedRelays[].linkSelectionstringLinkSelection is the exact RFC 3527 link selection address the relay sends, inside this subnet; empty refuses the extension.
Length: at most 15
spec.trustedRelays[].serverIdentifierstringServerIdentifier is the exact RFC 5107 server identifier override the relay sends; empty refuses the extension.
Length: at most 15
spec.trustedRelays[].sourceIPstringRequired. SourceIP is the IPv4 source address of the relay's packets as kudurru receives them (the LoadBalancer Service must preserve it).
Length: at most 15
spec.trustedRelays[].sourcePortintegerSourcePort is the relay's UDP source port; zero means 67. An alternate port requires the RFC 8357 relay port suboption.
Format: int32
Range: 0 to 65535

Status

DHCPScopeStatus is written by the replica that serves DHCP.

FieldTypeDescription
status.activeLeasesintegerActiveLeases counts bound leases.
status.conditions[]ConditionList type: map, keyed by type
status.conflictingLeasesintegerConflictingLeases counts live leases this spec no longer allows; they are not renewed and end at expiry.
status.observedGenerationintegerFormat: int64
status.servingPodstringServingPod is the replica that holds the DHCP allocator term.

Example

deploy/kustomize/samples/kudurru.io_v1alpha1_dhcpscope.yaml:

# A DHCPv4 scope served in Kubernetes (dhcp.enabled in the chart). The
# router relays DHCP for 192.168.30.0/24 to the chart's dhcp.serverAddress;
# its source address and giaddr are trusted below. Annotate a scope you
# manage in Git with kudurru.io/managed-by (e.g. gitops:argocd) so the
# dashboard shows it read-only.
apiVersion: kudurru.io/v1alpha1
kind: DHCPScope
metadata:
  name: iot
  annotations:
    kudurru.io/managed-by: gitops:argocd
spec:
  subnet: 192.168.30.0/24
  rangeStart: 192.168.30.100
  rangeEnd: 192.168.30.199
  router: 192.168.30.1
  dnsServers: [192.168.10.53]
  domainName: iot.home.arpa
  leaseDuration: 12h
  registerDNS: true
  dnsTTL: 30s
  trustedRelays:
    - sourceIP: 192.168.30.1
      gatewayIP: 192.168.30.1
  reservations:
    - mac: "02:42:ac:11:00:02"
      ip: 192.168.30.10
      hostname: thermostat

Source: docs-site/content/reference/crds/dhcpscope.md