https://github.com/mutablelogic/go-coredns-nomad
coredns with nomad plugin for service discovery
https://github.com/mutablelogic/go-coredns-nomad
Last synced: 2 months ago
JSON representation
coredns with nomad plugin for service discovery
- Host: GitHub
- URL: https://github.com/mutablelogic/go-coredns-nomad
- Owner: mutablelogic
- License: apache-2.0
- Created: 2024-01-24T20:13:51.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-25T07:52:17.000Z (over 1 year ago)
- Last Synced: 2025-02-05T00:43:14.764Z (4 months ago)
- Language: Dockerfile
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-coredns-nomad
coredns with nomad plugin for service discovery. This repository will build a docker container
with coredns and the nomad plugin.## Using the container
In order to run this container, and have service discovery
work on port 1053, you need to pass in the following environment variables:* `NOMAD_ADDR` - the address of the nomad server
* `NOMAD_TOKEN` - the token to use to query the nomad server
* `NOMAD_TTL` - the TTL for the DNS records, in secondsFor example:
```sh
docker run --name coredns-nomad --rm -p 1053:53 \
--env NOMAD_ADDR=http://nomad:4646/ \
--env NOMAD_TOKEN=XXXXXX \
--env NOMAD_TTL=10 \
ghcr.io/mutablelogic/coredns-nomad:v1.11.1
```When you want to test it using dig, query `..nomad`. For example,
```sh
dig +tcp -p 1053 @localhost service.default.nomad
```## Building the container
You can use the pre-built container from the GitHub Container Registry (for arm64 or amd64 on Linux),
or you can build it yourself.```sh
git clone [email protected]:mutablelogic/go-coredns-nomad.git
cd go-coredns-nomad
docker build \
--tag ${REGISTRY}/${USERNAME}/coredns-nomad:v1.11.1 \
--build-arg ARCH=$(arch) \
--build-arg PLATFORM=$(uname -s | tr '[:upper:]' '[:lower:]') \
--build-arg VERSION=v1.11.1 \
-f etc/docker/Dockerfile .
```