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 version | kudurru.io/v1alpha1 |
| Kind | DHCPScope |
| Scope | Cluster |
| Resource | dhcpscopes.kudurru.io |
| Short names | dhcpscope |
| Subresources | status |
Columns of kubectl get dhcpscopes:
| Column | Type | Value |
|---|---|---|
| SUBNET | string | .spec.subnet |
| LEASES | integer | .status.activeLeases |
| SERVING | string | .status.servingPod |
| READY | string | .status.conditions[?(@.type=="Ready")].status |
| AGE | date | .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.
| Field | Type | Description |
|---|---|---|
spec.bootFile | string | Length: at most 128 |
spec.bootProfiles | []object | Items: at most 32 |
spec.bootProfiles[].architecture | integer | Required. Format: int32Range: 0 to 65535 |
spec.bootProfiles[].bootFile | string | Length: at most 128 |
spec.bootProfiles[].bootServer | string | Length: at most 15 |
spec.bootProfiles[].bootServerName | string | Length: at most 64 |
spec.bootServer | string | Length: at most 15 |
spec.bootServerName | string | Length: at most 64 |
spec.classlessRoutes | []object | Items: at most 32 |
spec.classlessRoutes[].destination | string | Required. Length: at most 18 |
spec.classlessRoutes[].router | string | Required. Length: at most 15 |
spec.conflictDetection | string | ConflictDetection probes a new address before offering it: icmp (default; needs NET_RAW) or disabled. One of: auto, icmp, disabled |
spec.dnsServers | []string | Required. DNSServers are the IPv4 DNS servers advertised to clients. Items: 1 to 63 |
spec.dnsTTL | string | DNSTTL is the TTL of those records, from 1s to 1h, clamped to the remaining lease time. Default: 30s |
spec.domainName | string | DomainName is the client domain, also the domain of local DNS records when registerDNS is set. Length: at most 253 |
spec.domainSearch | []string | Items: at most 32 |
spec.leaseDuration | string | LeaseDuration is in whole seconds, from one minute to 30 days. Default: 12h |
spec.ntpServers | []string | Items: at most 63 |
spec.probeTimeout | string | ProbeTimeout bounds the ICMP probe; default 200ms. |
spec.rangeEnd | string | Required. Length: at most 15 |
spec.rangeStart | string | Required. RangeStart and RangeEnd bound the dynamic pool, inclusive. Length: at most 15 |
spec.registerDNS | boolean | RegisterDNS publishes A and PTR records for bound leases on every replica. |
spec.reservations | []object | Reservations assign fixed addresses to MAC addresses. Items: at most 4096 |
spec.reservations[].hostname | string | Length: at most 253 |
spec.reservations[].ip | string | Required. Length: at most 15 |
spec.reservations[].mac | string | Required. Length: at most 17 |
spec.router | string | Required. Router is the default gateway advertised to clients. Length: at most 15 |
spec.subnet | string | Required. Subnet is the client IPv4 subnet in canonical CIDR form; it must not overlap another scope. Length: at most 18 |
spec.trustedRelays | []object | Required. TrustedRelays are the relays allowed to forward this subnet's clients. At least one is required. Items: 1 to 64 |
spec.trustedRelays[].gatewayIP | string | Required. GatewayIP is the giaddr the relay writes for this subnet; it is never allocated. Length: at most 15 |
spec.trustedRelays[].linkSelection | string | LinkSelection is the exact RFC 3527 link selection address the relay sends, inside this subnet; empty refuses the extension. Length: at most 15 |
spec.trustedRelays[].serverIdentifier | string | ServerIdentifier is the exact RFC 5107 server identifier override the relay sends; empty refuses the extension. Length: at most 15 |
spec.trustedRelays[].sourceIP | string | Required. 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[].sourcePort | integer | SourcePort is the relay's UDP source port; zero means 67. An alternate port requires the RFC 8357 relay port suboption. Format: int32Range: 0 to 65535 |
Status
DHCPScopeStatus is written by the replica that serves DHCP.
| Field | Type | Description |
|---|---|---|
status.activeLeases | integer | ActiveLeases counts bound leases. |
status.conditions | []Condition | List type: map, keyed by type |
status.conflictingLeases | integer | ConflictingLeases counts live leases this spec no longer allows; they are not renewed and end at expiry. |
status.observedGeneration | integer | Format: int64 |
status.servingPod | string | ServingPod 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