Score:1

How do I refer to the 'LXD host from an LXD container

mm flag

We currently run our services in a series of LXD containers - we have one running a nginx server as a reverse proxy, pointing at each service, and where I need to connect to a container from the host or another container, I use the LXD assigned hostname. It works very well, and its extremely clean.

I'm currently looking at setting up grafana for monitoring in a container and hook in a prometheus instance in the host to feed it data. It would probably be helpful to be able to refer to the LXD host by a hostname - like I do for the containers for this and other projects. What would be the 'correct' way to refer to the host from a service running on a container?

Score:1
kz flag
Bob

If you are using a LXD managed network, which sets up a bridged network and also runs a dnsmasq DHCP server to provide the behaviour you describe, the host is reachable under the domain name _gateway.<domain>, e.g. _gateway.lxd (or just _gateway using DNS search suffixes). Requires minimum LXD 4.16.

If you are using any other network type, including unmanaged bridges, then there is no built-in way to do so.

Note that to actually access a service on the host using the _gateway name, the service must be listening on the LXD bridge interface/address.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.