feat: Add NetworkPolicy for flightdeck component#68
Conversation
Add flightdeck to the list of components that get NetworkPolicies created by the site controller. This ensures flightdeck has consistent network isolation like other components (connect, workbench, home, etc). The policy allows: - Ingress from traefik namespace on port 8080 (web traffic) - Ingress from alloy namespace on port 8080 (metrics) - Egress to all destinations (same as other components)
|
Claude finished @ian-flores's task —— View job Review Complete
Submitted a non-blocking review with feedback on the implementation. The PR follows established patterns well - main verification items are around label matching during testing. |
There was a problem hiding this comment.
Review Summary
The implementation follows established patterns and addresses a real gap - flightdeck was the only component without a NetworkPolicy.
What looks good
- Follows existing patterns: The
reconcileFlightdeckNetworkPolicyfunction mirrors the structure ofreconcileHomeNetworkPolicy- usingKubernetesInstanceLabelKeyfor pod selection and allowing all egress with restricted ingress. - Cleanup properly handled:
flightdeckadded to the cleanup list in alphabetical order. - Port constant:
DefaultPortFlightdeckHTTP(8080) added correctly intcpport.go. - Correct reconciliation order: The flightdeck reconcile call is placed at the end of the chain, which is fine.
Items to verify during testing
-
Label matching (
site_controller_networkpolicies.go:746-749): The pod selector usesKubernetesInstanceLabelKey(app.kubernetes.io/instance). Verify the flightdeck deployment has this label set to<site-name>-flightdeck. Some components useComponentLabelKeyinstead (like workbench-session), so confirm this matches how flightdeck pods are labeled. -
All-egress policy (
site_controller_networkpolicies.go:755-757): The empty egress rule{}allows all egress, which matcheshomeandpackagemanager. This seems appropriate for a dashboard component, but worth confirming flightdeck doesn't need more restricted egress.
Minor observations
- No unit tests added, but I notice there are no existing unit tests for other network policy reconcilers either, so this is consistent with the current test coverage.
Overall, this is a clean, well-structured addition that follows existing conventions.
# [1.6.0](v1.5.0...v1.6.0) (2026-02-04) ### Features * Add NetworkPolicy for flightdeck component ([#68](#68)) ([fbdf600](fbdf600))
Summary
Add flightdeck to the list of components that get NetworkPolicies created by the site controller.
Previously, flightdeck was the only component without a NetworkPolicy, which caused issues in environments with default-deny network policies.
Changes
DefaultPortFlightdeckHTTPconstant (8080)reconcileFlightdeckNetworkPolicy()functionTest plan