Support enterprise whisker-backend with Linseed upstream - #4861
Conversation
e7aac2c to
ed02bd2
Compare
There was a problem hiding this comment.
Pull request overview
Adds enterprise support to the whisker-backend by wiring it to Linseed (instead of Goldmane) for flow data, including RBAC, mTLS, and network policy plumbing for enterprise variants. Non-enterprise (Calico) paths still render Goldmane env/policy as before.
Changes:
- Render enterprise Whisker
ClusterRole/ClusterRoleBindingand Linseed-specific env vars (LINSEED_URL,LINSEED_CA_PATH,LINSEED_TOKEN_PATH,LINSEED_CLUSTER_ID,LINSEED_CLIENT_CERT/KEY_PATH); split network policy into enterprise (Manager ingress + Linseed/kube-apiserver egress) vs Calico (Goldmane egress). - Controller: skip Goldmane CR requirement for enterprise, watch
TigeraLinseedSecret, switch trusted bundle source to Linseed for enterprise, and add a missingreturnafterSetDegradedin trusted bundle creation. - Wire Manager → Whisker egress and Linseed ← Whisker ingress via new
WhiskerEntityRule/WhiskerSourceEntityRulehelpers; update expected policy JSON fixtures and Manager test egress count.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/render/whisker/component.go | Adds enterprise constants, RBAC objects, Linseed env vars, ingress/egress rules in network policy |
| pkg/render/whisker/component_test.go | Adds enterprise object count, deployment, RBAC, and network policy test cases |
| pkg/render/manager.go | Adds Manager egress rule to Whisker |
| pkg/render/manager_test.go | Updates expected egress rule count from 11 to 12 |
| pkg/render/logstorage/linseed/linseed.go | Adds Whisker as ingress source to Linseed |
| pkg/render/common/networkpolicy/networkpolicy.go | Adds WhiskerEntityRule and WhiskerSourceEntityRule helpers |
| pkg/controller/whisker/controller.go | Skips Goldmane CR requirement for enterprise, watches Linseed secret, switches trusted bundle source, adds missing return on error |
| pkg/render/testutils/expected_policies/manager.json | Adds Manager→Whisker egress entry |
| pkg/render/testutils/expected_policies/manager_ocp.json | Adds Manager→Whisker egress entry |
| pkg/render/testutils/expected_policies/linseed.json | Adds Whisker ingress entry |
| pkg/render/testutils/expected_policies/linseed_ocp.json | Adds Whisker ingress entry |
| pkg/render/testutils/expected_policies/linseed_dpi_enabled.json | Adds Whisker ingress entry |
| pkg/render/testutils/expected_policies/linseed_ocp_dpi_enabled.json | Adds Whisker ingress entry |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cfbff08 to
8bc0e61
Compare
|
This PR is stale because it has been open for 60 days with no activity. |
8bc0e61 to
5172c8a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.
Suppressed comments (2)
pkg/controller/whisker/controller.go:222
- Avoid hard-coding the backend Service name here. Using the shared constant keeps certificate SAN generation aligned with the rendered Service name and prevents drift if the Service name changes in the renderer.
whiskerBackendCertificateNames := dns.GetServiceDNSNames("whisker-backend", whisker.WhiskerNamespace, r.clusterDomain)
pkg/render/manager.go:114
- These Whisker-related constants are duplicated from pkg/render/whisker (notably namespace/service name/ports). This creates a drift risk over time; consider moving the shared Service coordinates into the pkg/render package (or another shared package) so both manager rendering and whisker rendering reference the same single source of truth without an import cycle.
// Whisker-backend Service coordinates, mirroring pkg/render/whisker —
// importing that package here would create an import cycle (it imports
// render).
WhiskerNamespace = "calico-system"
WhiskerDeploymentName = "whisker"
WhiskerBackendServiceName = "whisker-backend"
WhiskerBackendServicePort = 8443
WhiskerBackendTargetPort = 3002
5172c8a to
c31d14c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.
Suppressed comments (2)
pkg/controller/whisker/controller.go:223
- Avoid hard-coding the whisker-backend Service name here. The renderer already defines whisker.WhiskerBackendServiceName, and using the constant prevents drift if the Service name is ever changed.
whiskerBackendCertificateNames := dns.GetServiceDNSNames("whisker-backend", whisker.WhiskerNamespace, r.clusterDomain)
whiskerBackendCertificateNames = append(whiskerBackendCertificateNames, "localhost", "127.0.0.1")
pkg/render/manager.go:114
- These Whisker constants duplicate values defined in pkg/render/whisker/component.go, which risks the Manager↔Whisker wiring drifting over time. Consider moving the whisker-backend Service coordinates to a shared location (e.g., exported consts in pkg/render) so both packages reference the same definition without an import cycle.
// Whisker-backend Service coordinates, mirroring pkg/render/whisker —
// importing that package here would create an import cycle (it imports
// render).
WhiskerNamespace = "calico-system"
WhiskerDeploymentName = "whisker"
WhiskerBackendServiceName = "whisker-backend"
WhiskerBackendServicePort = 8443
WhiskerBackendTargetPort = 3002
c31d14c to
4da86bd
Compare
For Calico Enterprise the Whisker UI is a manager UI module, so only the whisker-backend container is deployed — no SPA container, nginx config, UI Service or nginx TLS key pair. The backend gets the Linseed upstream env, a ClusterRole granting linseed.tigera.io flows access, and Linseed's network policy admits it. The manager wires the module up when a Whisker CR exists: the manager container gets SUPPORTS_FLOW_LOGS for the UI feature flag, Voltron gets a /whisker-backend proxy target pointing at the new whisker-backend Service, and the manager/whisker network policies allow that path.
4da86bd to
9aa8865
Compare
Summary
Notes
WHISKER_FEATURESenv var) is intentionally excluded — it will be handled separately once the UI team integrates Whisker as a ui-module in Manager