-
Notifications
You must be signed in to change notification settings - Fork 40
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
Blueprint execution: Send OPTE firewall rules for services #5233
Conversation
move `plumb_service_firewall_rules` and its dependencies
// After deploying omicron zones, we may need to refresh OPTE service | ||
// firewall rules. This is an idempotent operation, so we don't attempt | ||
// to optimize out calling it in unnecessary cases, although we expect | ||
// _most_ cases this is not needed. | ||
nexus_networking::plumb_service_firewall_rules( | ||
datastore, | ||
&opctx, | ||
&[], | ||
&opctx, | ||
&opctx.log, | ||
) | ||
.await | ||
.context("failed to plumb service firewall rules to sleds") | ||
.map_err(|err| vec![err])?; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to triple-check -- this is the real meat of this PR, and the rest is more-or-less refactoring?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct
c788362
to
f37525f
Compare
Installed this on madrid, then replaced the --- a/nexus/src/app/deployment.rs
+++ b/nexus/src/app/deployment.rs
@@ -122,7 +122,7 @@ impl super::Nexus {
&sled_rows,
&zpool_rows,
&ip_pool_range_rows,
- NEXUS_REDUNDANCY,
+ NEXUS_REDUNDANCY + 1,
)?;
// The choice of which inventory collection to use here is not I ran through the normal blueprint dance, and ended up with a fourth Nexus running with an external IP:
and correct OPTE firewall rules:
and confirmed I could talk to it from outside
|
use std::net::SocketAddrV6; | ||
use uuid::Uuid; | ||
|
||
pub fn sled_lookup<'a>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use LookupPath
directly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just moving stuff what existed without trying to make any changes. I can drop this one and keep Nexus::sled_client
around? (That one is called a half dozen times or so; I guess we could also replace all of those with LookupPath
invocations, but that's entirely unrelated to this PR, I think.)
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
//! Functionality related to firewall rules. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the contents of this file basically just moved, not changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct; only the function parameters changed (to replace self
with datastore
, etc.), and the corresponding changes to the function bodies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I see that now. Not a big deal either way.
This is the reworked and caught-up-with-main #5157 (which I'll close momentarily). I believe I addressed all the comments on the PR except those related to its extension trait style and the
nexus-capabilities
crate. This introduces a more focusednexus-networking
crate that exposes free functions instead of extension traits.I'll run this through madrid before merging, but I believe it should work (absent any mistakes I made merging changes across branches) now that #5202 has landed.
Closes #4886