Skip to content

Commit

Permalink
[internal-dns] Shove service discovery into a zone (#807)
Browse files Browse the repository at this point in the history
Builds on #800 , actually launching the internal DNS subsystem as a Zone.

Part of #718
  • Loading branch information
smklein authored Apr 25, 2022
1 parent d4c11d2 commit 8cc6e1f
Show file tree
Hide file tree
Showing 12 changed files with 77 additions and 23 deletions.
6 changes: 0 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/how-to-run.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ unique local addresses in the subnet of the first Sled Agent: `fd00:1122:3344:1:
| Crucible Downstairs 1 | `[fd00:1122:3344:1::6]:32345`
| Crucible Downstairs 2 | `[fd00:1122:3344:1::7]:32345`
| Crucible Downstairs 3 | `[fd00:1122:3344:1::8]:32345`
| Internal DNS | `[fd00:1122:3344:1::9]:5353`
|===================================================================================================

Note that Sled Agent runs in the global zone and is the one responsible for bringing up all the other
Expand Down
6 changes: 0 additions & 6 deletions internal-dns-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,9 @@ edition = "2021"
license = "MPL-2.0"

[dependencies]
anyhow = "1.0"
clap = { version = "3.1", features = [ "derive" ] }
progenitor = { git = "https://github.com/oxidecomputer/progenitor" }
serde = { version = "1.0", features = [ "derive" ] }
serde_json = "1.0"
slog = { version = "2.5.0", features = [ "max_level_trace", "release_max_level_debug" ] }
slog-term = "2.7"
slog-async = "2.7"
slog-envlogger = "2.2"
structopt = "0.3"
tokio = { version = "1.17", features = [ "full" ] }
reqwest = { version = "0.11", features = ["json", "rustls-tls", "stream"] }
2 changes: 1 addition & 1 deletion internal-dns/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ license = "MPL-2.0"
[dependencies]
anyhow = "1.0"
clap = { version = "3.1", features = [ "derive" ] }
internal-dns-client = { path = "../internal-dns-client" }
dropshot = { git = "https://github.com/oxidecomputer/dropshot", branch = "main", features = [ "usdt-probes" ] }
pretty-hex = "0.3.0"
schemars = "0.8"
Expand All @@ -26,7 +27,6 @@ trust-dns-server = "0.21"

[dev-dependencies]
expectorate = "1.0.5"
internal-dns-client = { path = "../internal-dns-client" }
omicron-test-utils = { path = "../test-utils" }
openapiv3 = "1.0"
openapi-lint = { git = "https://github.com/oxidecomputer/openapi-lint", branch = "main" }
Expand Down
File renamed without changes.
9 changes: 9 additions & 0 deletions package-manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ to = "/opt/oxide/cockroachdb/sql"
from = "smf/cockroachdb"
to = "/var/svc/manifest/site/cockroachdb"

[package.internal-dns]
rust.binary_names = ["dnsadm", "dns-server"]
rust.release = true
service_name = "internal-dns"
zone = true
[[package.internal-dns.paths]]
from = "smf/internal-dns"
to = "/var/svc/manifest/site/internal-dns"

# Packages not built within Omicron, but which must be imported.

# Refer to
Expand Down
17 changes: 17 additions & 0 deletions smf/internal-dns/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[dropshot]
bind_address = "[fd00:1122:3344:1::9]:5353"
request_body_max_bytes = 1048576

[dns]
bind_address = "[fd00:1122:3344:1::9]:53"

[log]
# Show log messages of this level and more severe
level = "info"
mode = "file"
path = "/var/oxide/internal-dns.log"
if_exists = "append"

[data]
nmax_messages = 16
storage_path = "/var/oxide/dns"
36 changes: 36 additions & 0 deletions smf/internal-dns/manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0"?>
<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">

<service_bundle type='manifest' name='internal-dns'>

<service name='system/illumos/internal-dns' type='service' version='1'>
<create_default_instance enabled='false' />
<single_instance />

<dependency name='multi_user' grouping='require_all' restart_on='none'
type='service'>
<service_fmri value='svc:/milestone/multi-user:default' />
</dependency>

<exec_method type='method' name='start'
exec='ctrun -l child -o noorphan,regent /opt/oxide/internal-dns/bin/dns-server --config-file /var/svc/manifest/site/internal-dns/config.toml &amp;'
timeout_seconds='0' />
<exec_method type='method' name='stop' exec=':kill' timeout_seconds='0' />

<property_group name='startd' type='framework'>
<propval name='duration' type='astring' value='contract' />
</property_group>

<stability value='Unstable' />

<template>
<common_name>
<loctext xml:lang='C'>Internal DNS</loctext>
</common_name>
<description>
<loctext xml:lang='C'>Oxide's Internal DNS Service</loctext>
</description>
</template>
</service>

</service_bundle>
11 changes: 3 additions & 8 deletions smf/nexus/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,9 @@ bind_address = "[fd00:1122:3344:1::3]:12221"
[log]
# Show log messages of this level and more severe
level = "info"

# Example output to a terminal (with colors)
mode = "stderr-terminal"

# Example output to a file, appending if it already exists.
#mode = "file"
#path = "logs/server.log"
#if_exists = "append"
mode = "file"
path = "/var/oxide/nexus.log"
if_exists = "append"

# Configuration for interacting with the timeseries database
[timeseries_db]
Expand Down
4 changes: 3 additions & 1 deletion smf/oximeter/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ batch_interval = 5 # In seconds

[log]
level = "debug"
mode = "stderr-terminal"
mode = "file"
path = "/var/oxide/oximeter.log"
if_exists = "append"

[dropshot]
bind_address = "[fd00:1122:3344:1::4]:12223"
4 changes: 4 additions & 0 deletions smf/sled-agent/config-rss.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,7 @@ name = "oximeter"
addresses = [
"[fd00:1122:3344:1::4]:12223",
]

[[request.service]]
name = "internal-dns"
addresses = [ "[fd00:1122:3344:1::9]:5353" ]
4 changes: 3 additions & 1 deletion smf/sled-agent/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ zpools = [

[log]
level = "info"
mode = "stderr-terminal"
mode = "file"
path = "/var/oxide/sled-agent.log"
if_exists = "append"

0 comments on commit 8cc6e1f

Please sign in to comment.