Skip to content

Support enterprise whisker-backend with Linseed upstream - #4861

Open
hjiawei wants to merge 1 commit into
tigera:masterfrom
hjiawei:hjiawei/whisker-commercial-flow-logs
Open

Support enterprise whisker-backend with Linseed upstream#4861
hjiawei wants to merge 1 commit into
tigera:masterfrom
hjiawei:hjiawei/whisker-commercial-flow-logs

Conversation

@hjiawei

@hjiawei hjiawei commented May 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Enable whisker-backend for Calico Enterprise by configuring it to use Linseed as the flow data source instead of Goldmane
  • Add RBAC (ClusterRole/ClusterRoleBinding) for Linseed flows, TokenReview, and SubjectAccessReview so whisker-backend can authenticate users and filter flows by RBAC
  • Wire up network policies: Linseed egress, kube-apiserver egress, Manager ingress for whisker; Linseed ingress from whisker; Manager egress to whisker
  • Add mTLS client certs and cluster ID support for Linseed communication

Notes

  • Whisker frontend enterprise deployment (enterprise image, WHISKER_FEATURES env var) is intentionally excluded — it will be handled separately once the UI team integrates Whisker as a ui-module in Manager
  • This PR only covers the whisker-backend container changes needed for enterprise Linseed integration

@marvin-tigera marvin-tigera added this to the v1.43.0 milestone May 26, 2026
@hjiawei
hjiawei force-pushed the hjiawei/whisker-commercial-flow-logs branch 2 times, most recently from e7aac2c to ed02bd2 Compare May 26, 2026 02:39
@hjiawei
hjiawei marked this pull request as ready for review May 26, 2026 21:22
@hjiawei
hjiawei requested a review from a team as a code owner May 26, 2026 21:22
@hjiawei
hjiawei requested a lite review from Copilot May 26, 2026 21:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/ClusterRoleBinding and 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 missing return after SetDegraded in trusted bundle creation.
  • Wire Manager → Whisker egress and Linseed ← Whisker ingress via new WhiskerEntityRule/WhiskerSourceEntityRule helpers; 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.

@hjiawei
hjiawei force-pushed the hjiawei/whisker-commercial-flow-logs branch 4 times, most recently from cfbff08 to 8bc0e61 Compare June 3, 2026 05:56
@radTuti radTuti modified the milestones: v1.43.0, v1.44.0 Jun 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open for 60 days with no activity.

@github-actions github-actions Bot added the stale label Aug 12, 2026
@danudey danudey modified the milestones: v1.44.0, v1.45.0 Aug 17, 2026
@hjiawei
hjiawei force-pushed the hjiawei/whisker-commercial-flow-logs branch from 8bc0e61 to 5172c8a Compare August 17, 2026 20:57
Copilot AI review requested due to automatic review settings August 17, 2026 20:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@github-actions github-actions Bot removed the stale label Aug 18, 2026
@hjiawei
hjiawei force-pushed the hjiawei/whisker-commercial-flow-logs branch from 5172c8a to c31d14c Compare August 18, 2026 00:44
Copilot AI review requested due to automatic review settings August 18, 2026 00:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@hjiawei
hjiawei requested review from caseydavenport and pasanw and a balanced review from Copilot August 18, 2026 01:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@hjiawei
hjiawei force-pushed the hjiawei/whisker-commercial-flow-logs branch from c31d14c to 4da86bd Compare August 28, 2026 22:01
Copilot AI review requested due to automatic review settings August 28, 2026 22:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.
Copilot AI review requested due to automatic review settings August 29, 2026 18:48
@hjiawei
hjiawei force-pushed the hjiawei/whisker-commercial-flow-logs branch from 4da86bd to 9aa8865 Compare August 29, 2026 18:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants