How to deploy dnsmasq in Kubernetes?

18 views
Skip to first unread message

Klaus Ma

unread,
Nov 10, 2022, 10:06:27 AM11/10/22
to dev
Hi team,

I'm working on host provisioning by PXE protocol which dependent on DHCP server. Currently, I deploy dnsmasq in Kubernetes with hostnetwork; but it seems does not work with NodePort.

Is there any suggestions on that?

-- Klaus

haosdent

unread,
Nov 10, 2022, 10:10:36 AM11/10/22
to klaus1...@gmail.com, dev

--
You received this message because you are subscribed to the Google Groups "dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dev+uns...@kubernetes.io.
To view this discussion on the web visit https://groups.google.com/a/kubernetes.io/d/msgid/dev/84733b30-7307-4df0-baa6-8ec932bde25an%40kubernetes.io.
--
Best Regards,
Haosdent Huang

Klaus Ma

unread,
Nov 10, 2022, 9:18:14 PM11/10/22
to dev, haos...@gmail.com, dev, Klaus Ma
Is there any document on dnsmasq? tinkerbell seems build iPXE server from scratch :)

Lennart Jern

unread,
Nov 11, 2022, 7:27:25 AM11/11/22
to dev, klaus1...@gmail.com, haos...@gmail.com
Hi!

I have successfully used this documentation for dnsmasq before: https://linux.die.net/man/8/dnsmasq

As for hostNetwork + NodePort, I think that is not possible to do. If you use hostNetwork then dnsmasq will be "outside" of the kubernetes network and won't be able to work with NodePorts.
Do you need NodePort for dnsmasq itself or is that for something else? In that case it may be a better idea to split it into a separate pod.

I think you are probably already aware of this, but anyway, we have an example for how to deploy Ironic with dnsmasq in the baremetal-operator repo: https://github.com/metal3-io/baremetal-operator/blob/main/ironic-deployment/ironic/ironic.yaml
It uses hostNetwork but not NodePorts.


// Lennart


From: Klaus Ma <klaus1...@gmail.com>
Sent: Friday, November 11, 2022 04:18
To: dev <d...@kubernetes.io>
Cc: haos...@gmail.com <haos...@gmail.com>; dev <d...@kubernetes.io>; Klaus Ma <klaus1...@gmail.com>
Subject: Re: How to deploy dnsmasq in Kubernetes?
 
Reply all
Reply to author
Forward
0 new messages