Skip to content

[nexus][sled-agent] DNS services are backed by explicit datasets #3022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 82 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
7b54128
[sled-agent] Make service_manager responsible for storage services too
smklein Apr 28, 2023
f410325
Merge branch 'main' into storage-manager-cleanup
smklein Apr 28, 2023
0b4b040
CRDB auto-format on boot
smklein Apr 28, 2023
ef9517c
better use of 'unique_name' (for storage zones), auto-launch storage …
smklein Apr 30, 2023
f1fd1f5
Merge branch 'main' into storage-manager-cleanup
smklein Apr 30, 2023
3a9ad87
Merge branch 'main' into storage-manager-cleanup
smklein Apr 30, 2023
4377f1d
Stop deleting chelsio addresses during uninstall (#2953)
smklein Apr 30, 2023
ec3b1e4
[RSS] Explicit set of Bootstrap Agents
smklein Apr 30, 2023
c812609
Merge branch 'storage-manager-cleanup' into rss-explicit
smklein Apr 30, 2023
9d00c93
Fix tests
smklein Apr 30, 2023
8a08090
Merge branch 'storage-manager-cleanup' into rss-explicit
smklein Apr 30, 2023
cfb7cbc
make serialization happier
smklein Apr 30, 2023
2ab628b
Store service ledgers in duplicate in M.2s
smklein May 1, 2023
c37e57e
Improve parsing for toml, openapi
smklein May 1, 2023
4cbde16
Merge branch 'rss-explicit' into service-ledger
smklein May 1, 2023
541f68d
Remove the comments about the ledger, we do that in #2972
smklein May 1, 2023
5d59951
configs -> ledgers
smklein May 1, 2023
ed20fff
review feedback
smklein May 1, 2023
ba2ba2c
Merge branch 'main' into storage-manager-cleanup
smklein May 1, 2023
afc03bd
Merge branch 'storage-manager-cleanup' into rss-explicit
smklein May 1, 2023
fbae358
Merge branch 'rss-explicit' into service-ledger
smklein May 1, 2023
0ae5531
We should allow synthetic disks to be used as M2s
smklein May 1, 2023
c970c4f
Merge branch 'main' into storage-manager-cleanup
smklein May 2, 2023
c00e2db
Merge branch 'storage-manager-cleanup' into rss-explicit
smklein May 2, 2023
599f669
Merge branch 'main' into storage-manager-cleanup
smklein May 2, 2023
e2b1a5b
Merge branch 'storage-manager-cleanup' into rss-explicit
smklein May 2, 2023
96c8fb4
Merge branch 'rss-explicit' into service-ledger
smklein May 2, 2023
e346367
[sled-agent and friends] std::path to camino
smklein May 2, 2023
2487972
Merge branch 'main' into storage-manager-cleanup
smklein May 2, 2023
56a73e3
Merge branch 'storage-manager-cleanup' into rss-explicit
smklein May 2, 2023
488759e
Merge branch 'rss-explicit' into service-ledger
smklein May 2, 2023
ef6756d
Fix indexing
smklein May 2, 2023
6aef2e7
Merge branch 'main' into storage-manager-cleanup
smklein May 2, 2023
b84515f
Merge branch 'storage-manager-cleanup' into rss-explicit
smklein May 2, 2023
fde59b6
Merge branch 'rss-explicit' into service-ledger
smklein May 2, 2023
b62a351
Merge branch 'service-ledger' into take-the-sled-to-the-camino
smklein May 2, 2023
c621c53
end-to-end tests too
smklein May 2, 2023
02cb539
Use ledger in RSS
smklein May 3, 2023
6718f5f
Merge branch 'main' into storage-manager-cleanup
smklein May 3, 2023
cbc90af
Merge branch 'storage-manager-cleanup' into rss-explicit
smklein May 3, 2023
03db64a
Merge branch 'service-ledger' into take-the-sled-to-the-camino
smklein May 3, 2023
ced5dc9
review feedback
smklein May 3, 2023
db4bd51
clippy
smklein May 3, 2023
843539a
Merge branch 'take-the-sled-to-the-camino' into var-oxide-how-about-n…
smklein May 3, 2023
c5947b6
Use the ledger for sled-agent-request
smklein May 3, 2023
884f6d5
better bootstrap agent init
smklein May 3, 2023
b201d58
Fix sled agent tests
smklein May 3, 2023
e3fe7e2
Remove /var/oxide from buildomat
smklein May 3, 2023
9abc1f2
Merge branch 'main' into storage-manager-cleanup
smklein May 3, 2023
18337e4
Merge branch 'storage-manager-cleanup' into rss-explicit
smklein May 3, 2023
dea9b3b
Merge branch 'service-ledger' into take-the-sled-to-the-camino
smklein May 3, 2023
737eb41
Merge branch 'take-the-sled-to-the-camino' into var-oxide-how-about-n…
smklein May 3, 2023
5494aa4
Merge branch 'main' into storage-manager-cleanup
smklein May 4, 2023
f9639ad
Merge branch 'storage-manager-cleanup' into rss-explicit
smklein May 4, 2023
b39ef3d
Merge branch 'service-ledger' into take-the-sled-to-the-camino
smklein May 4, 2023
0c9785b
Merge branch 'take-the-sled-to-the-camino' into var-oxide-how-about-n…
smklein May 4, 2023
92acdac
Ensure bootstrap agent sees all disks, await boot disk
smklein May 4, 2023
ef49515
synthetic
smklein May 4, 2023
9692493
wip
smklein May 4, 2023
a69bb81
Merge branch 'main' into var-oxide-how-about-nar-oxide
smklein May 4, 2023
4b6b584
Inject synthetic zpools in bootstrap agent
smklein May 4, 2023
e31ca88
Update path in comment
smklein May 4, 2023
164b5fd
fix documentation
smklein May 4, 2023
d6ad50b
rustdoc complaints
smklein May 4, 2023
3056a07
Merge branch 'var-oxide-how-about-nar-oxide' into opt-oxide
smklein May 4, 2023
b372f4d
[sled-agent] Look for zone images in the install dataset too
smklein May 5, 2023
529a035
moving dns to be a dataset-compatible filesystem
smklein May 5, 2023
278900b
Merge branch 'main' into var-oxide-how-about-nar-oxide
smklein May 5, 2023
39bb19b
Merge branch 'var-oxide-how-about-nar-oxide' into opt-oxide
smklein May 5, 2023
e55b772
Merge branch 'opt-oxide' into dns-dataset
smklein May 5, 2023
e1c378c
Socketaddrv6 usage
smklein May 5, 2023
5ea0183
Merge branch 'main' into var-oxide-how-about-nar-oxide
smklein May 5, 2023
9fdee1d
Merge branch 'var-oxide-how-about-nar-oxide' into opt-oxide
smklein May 5, 2023
d802924
Fix tests
smklein May 5, 2023
2f76870
Merge branch 'opt-oxide' into dns-dataset
smklein May 5, 2023
ad7b727
Box big errors for clippy
smklein May 5, 2023
e4a63bf
Merge branch 'main' into dns-dataset
bnaecker Jun 6, 2023
44adf07
Fix mismerge
bnaecker Jun 7, 2023
54ad19e
Merge branch 'main' into dns-dataset
smklein Jun 18, 2023
afef9ed
Fix minor mismerge, minimize diff, add comments
smklein Jun 18, 2023
5d857d9
minor cleanup
smklein Jun 18, 2023
bb9c30d
Notify nexus of both external DNS as dataset and service
smklein Jun 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion common/src/sql/dbinit.sql
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,9 @@ CREATE TABLE omicron.public.Zpool (
CREATE TYPE omicron.public.dataset_kind AS ENUM (
'crucible',
'cockroach',
'clickhouse'
'clickhouse',
'external_dns',
'internal_dns'
);

/*
Expand Down
8 changes: 8 additions & 0 deletions nexus/db-model/src/dataset_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ impl_enum_type!(
Crucible => b"crucible"
Cockroach => b"cockroach"
Clickhouse => b"clickhouse"
ExternalDns => b"external_dns"
InternalDns => b"internal_dns"
);

impl From<internal_api::params::DatasetKind> for DatasetKind {
Expand All @@ -33,6 +35,12 @@ impl From<internal_api::params::DatasetKind> for DatasetKind {
internal_api::params::DatasetKind::Clickhouse => {
DatasetKind::Clickhouse
}
internal_api::params::DatasetKind::ExternalDns => {
DatasetKind::ExternalDns
}
internal_api::params::DatasetKind::InternalDns => {
DatasetKind::InternalDns
}
}
}
}
21 changes: 4 additions & 17 deletions nexus/types/src/internal_api/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ use std::fmt;
use std::net::IpAddr;
use std::net::SocketAddr;
use std::net::SocketAddrV6;
use std::str::FromStr;
use uuid::Uuid;

/// Describes the role of the sled within the rack.
Expand Down Expand Up @@ -134,6 +133,8 @@ pub enum DatasetKind {
Crucible,
Cockroach,
Clickhouse,
ExternalDns,
InternalDns,
}

impl fmt::Display for DatasetKind {
Expand All @@ -143,27 +144,13 @@ impl fmt::Display for DatasetKind {
Crucible => "crucible",
Cockroach => "cockroach",
Clickhouse => "clickhouse",
ExternalDns => "external_dns",
InternalDns => "internal_dns",
};
write!(f, "{}", s)
}
}

impl FromStr for DatasetKind {
type Err = omicron_common::api::external::Error;

fn from_str(s: &str) -> Result<Self, Self::Err> {
use DatasetKind::*;
match s {
"crucible" => Ok(Crucible),
"cockroach" => Ok(Cockroach),
"clickhouse" => Ok(Clickhouse),
_ => Err(Self::Err::InternalError {
internal_message: format!("Unknown dataset kind: {}", s),
}),
}
}
}

/// Describes a dataset within a pool.
#[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)]
pub struct DatasetPutRequest {
Expand Down
4 changes: 3 additions & 1 deletion openapi/nexus-internal.json
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,9 @@
"enum": [
"crucible",
"cockroach",
"clickhouse"
"clickhouse",
"external_dns",
"internal_dns"
]
},
"DatasetPutRequest": {
Expand Down
63 changes: 63 additions & 0 deletions openapi/sled-agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,12 @@
"dataset_kind": {
"$ref": "#/components/schemas/DatasetKind"
},
"gz_address": {
"nullable": true,
"default": null,
"type": "string",
"format": "ipv6"
},
"id": {
"type": "string",
"format": "uuid"
Expand Down Expand Up @@ -677,6 +683,63 @@
"required": [
"type"
]
},
{
"type": "object",
"properties": {
"dns_address": {
"description": "The address at which the external DNS server is reachable.",
"type": "string"
},
"http_address": {
"description": "The address at which the external DNS server API is reachable.",
"type": "string"
},
"nic": {
"description": "The service vNIC providing external connectivity using OPTE.",
"allOf": [
{
"$ref": "#/components/schemas/NetworkInterface"
}
]
},
"type": {
"type": "string",
"enum": [
"external_dns"
]
}
},
"required": [
"dns_address",
"http_address",
"nic",
"type"
]
},
{
"type": "object",
"properties": {
"dns_address": {
"description": "The address at which the internal DNS server is reachable.",
"type": "string"
},
"http_address": {
"description": "The address at which the internal DNS server API is reachable.",
"type": "string"
},
"type": {
"type": "string",
"enum": [
"internal_dns"
]
}
},
"required": [
"dns_address",
"http_address",
"type"
]
}
]
},
Expand Down
1 change: 1 addition & 0 deletions sled-agent/src/http_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ async fn filesystem_put(
body_args.zpool_id,
body_args.dataset_kind,
body_args.address,
body_args.gz_address,
)
.await
.map_err(|e| Error::from(e))?;
Expand Down
44 changes: 43 additions & 1 deletion sled-agent/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,20 @@ pub enum DatasetKind {
CockroachDb,
Crucible,
Clickhouse,
ExternalDns {
/// The address at which the external DNS server API is reachable.
http_address: SocketAddrV6,
/// The address at which the external DNS server is reachable.
dns_address: SocketAddr,
/// The service vNIC providing external connectivity using OPTE.
nic: NetworkInterface,
},
InternalDns {
/// The address at which the internal DNS server API is reachable.
http_address: SocketAddrV6,
/// The address at which the internal DNS server is reachable.
dns_address: SocketAddrV6,
},
}

impl DatasetKind {
Expand All @@ -225,6 +239,8 @@ impl DatasetKind {
DatasetKind::CockroachDb => ZoneType::CockroachDb,
DatasetKind::Crucible => ZoneType::Crucible,
DatasetKind::Clickhouse => ZoneType::Clickhouse,
DatasetKind::ExternalDns { .. } => ZoneType::ExternalDns,
DatasetKind::InternalDns { .. } => ZoneType::InternalDns,
}
}

Expand All @@ -234,10 +250,16 @@ impl DatasetKind {
/// service in their zone. If that precondition is no longer true, this
/// interface should be re-visited.
pub fn service_type(&self) -> ServiceType {
match *self {
match self.clone() {
DatasetKind::CockroachDb => ServiceType::CockroachDb,
DatasetKind::Crucible => ServiceType::Crucible,
DatasetKind::Clickhouse => ServiceType::Clickhouse,
DatasetKind::ExternalDns { http_address, dns_address, nic } => {
ServiceType::ExternalDns { http_address, dns_address, nic }
}
DatasetKind::InternalDns { http_address, dns_address } => {
ServiceType::InternalDns { http_address, dns_address }
}
}
}
}
Expand All @@ -249,6 +271,17 @@ impl From<DatasetKind> for sled_agent_client::types::DatasetKind {
CockroachDb => Self::CockroachDb,
Crucible => Self::Crucible,
Clickhouse => Self::Clickhouse,
ExternalDns { http_address, dns_address, nic } => {
Self::ExternalDns {
http_address: http_address.to_string(),
dns_address: dns_address.to_string(),
nic: nic.into(),
}
}
InternalDns { http_address, dns_address } => Self::InternalDns {
http_address: http_address.to_string(),
dns_address: dns_address.to_string(),
},
}
}
}
Expand All @@ -260,6 +293,8 @@ impl From<DatasetKind> for nexus_client::types::DatasetKind {
CockroachDb { .. } => Self::Cockroach,
Crucible => Self::Crucible,
Clickhouse => Self::Clickhouse,
ExternalDns { .. } => Self::ExternalDns,
InternalDns { .. } => Self::InternalDns,
}
}
}
Expand All @@ -271,6 +306,8 @@ impl std::fmt::Display for DatasetKind {
Crucible => "crucible",
CockroachDb { .. } => "cockroachdb",
Clickhouse => "clickhouse",
ExternalDns { .. } => "external_dns",
InternalDns { .. } => "internal_dns",
};
write!(f, "{}", s)
}
Expand All @@ -290,6 +327,10 @@ pub struct DatasetEnsureBody {
pub dataset_kind: DatasetKind,
// The address on which the zone will listen for requests.
pub address: SocketAddrV6,
// The addresses in the global zone which should be created, if necessary
// to route to the service.
#[serde(default)]
pub gz_address: Option<Ipv6Addr>,
}

impl From<DatasetEnsureBody> for sled_agent_client::types::DatasetEnsureBody {
Expand All @@ -298,6 +339,7 @@ impl From<DatasetEnsureBody> for sled_agent_client::types::DatasetEnsureBody {
zpool_id: p.zpool_id,
dataset_kind: p.dataset_kind.into(),
address: p.address.to_string(),
gz_address: p.gz_address,
id: p.id,
}
}
Expand Down
Loading