diff --git a/infra/dhcp-server/deployment.yaml b/infra/dhcp-server/deployment.yaml new file mode 100644 index 00000000..f3996d3a --- /dev/null +++ b/infra/dhcp-server/deployment.yaml @@ -0,0 +1,31 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: dhcp-server + name: dhcp-server +spec: + replicas: 1 + selector: + matchLabels: + app: dhcp-server + template: + metadata: + labels: + app: dhcp-server + spec: + containers: + - image: networkboot/dhcpd:1.1.0 + name: dhcpd + volumeMounts: + - name: config + mountPath: /data/dhcpd.conf + subPath: dhcpd.conf + hostNetwork: true + volumes: + - name: config + configMap: + name: dhcp-server + items: + - key: dhcpd.conf + path: dhcpd.conf diff --git a/infra/dhcp-server/dhcpd.conf b/infra/dhcp-server/dhcpd.conf new file mode 100644 index 00000000..f6acf9aa --- /dev/null +++ b/infra/dhcp-server/dhcpd.conf @@ -0,0 +1,20 @@ +option space pxelinux; +option pxelinux.magic code 208 = string; +option pxelinux.configfile code 209 = text; +option pxelinux.pathprefix code 210 = text; +option pxelinux.reboottime code 211 = unsigned integer 32; +option architecture-type code 93 = unsigned integer 16; + +subnet 192.168.1.0 netmask 255.255.255.0 { + option routers 192.168.1.1; + range 192.168.1.2 192.168.1.254; + + class "pxeclients" { + match if substring (option vendor-class-identifier, 0, 9) = "PXEClient"; + next-server 192.168.1.19; + + if option architecture-type = 00:07 { + filename "ipxe.efi"; + } + } +}