Skip to content

feat: integrate v4 slices 1-8 and performance optimizations - #205

Open
JLCode-tech wants to merge 23 commits into
stagingfrom
work/v4-localhost
Open

feat: integrate v4 slices 1-8 and performance optimizations#205
JLCode-tech wants to merge 23 commits into
stagingfrom
work/v4-localhost

Conversation

@JLCode-tech

Copy link
Copy Markdown
Collaborator

Summary

This PR consolidates v4 Slices 1–8, Corporate CA / SSL proxy support, and the F5 BNK & Diagnostics Performance Optimizations onto staging.


Highlights

1. Core Feature Slices (1–8)

  • Slice 1 (Free-Form Regions & Cluster Discovery Metadata): Pattern-based validation for cloud regions; Azure/GCP validators; database migration v2_156.
  • Slice 2 (BNK Health Node/AZ Placement): Enriched BNK Health dashboard with nodeZone, nodeInstanceType, and per-component placement metadata.
  • Slice 3 (Connectivity & Integration Status): Persists cluster version, node_count, zones, last_synced_at, connectivity_status, access_method, and integration_status; added project/cluster connectivity endpoints.
  • Slice 4 (Credential-Template Cluster Auto-Detection): Dynamic cluster detection across AWS, IBM Cloud, Azure, and GCP credential templates; surfaces AWS SSO account metadata.
  • Slice 5 (BNK Resources Fleet Dashboard): Cluster-level consumption analytics, node capacity fallback, and metrics-server parallel query collection.
  • Slice 6 (TMM Traffic Stats & Egress/Gateway Views): Real-time TMM traffic stats, listener connection counts, and topology hit-counter badges.
  • Slice 7 (Operational State Polish): App Delivery ServiceDetail models, ReferenceGrants, Gateway API condition evaluations, and typed schemas.
  • Slice 8 & Nav Refactor: Relocated BNK Resources to Fleet, MCP to System, and Benchmarks to Observe sidebar.

2. Corporate CA & SSL Proxy Support

  • Mounted user-supplied CA certificates from certs/ into containers.
  • Combined bundle dynamic export (SSL_CERT_FILE, GIT_SSL_CAINFO, REQUESTS_CA_BUNDLE).
  • Resolved module library sync tag refs on shallow git clones.

3. F5 BNK & Diagnostics Performance Optimizations

  • TMM Debug Pod Discovery Reuse: list_tmm_debug_pods checks warm BNK discovery caches (bnk:pods:{cluster_id}) to eliminate redundant cluster sweeps.
  • CWC & QKView Caching: 60s/30s caching on availability, setup, and QKView lists with instant non-blocking tab renders.
  • Recovery Status Caching: 60s caching with placeholder data preservation during tab navigation.
  • Shared BNK Cache Alignment: Unified insight endpoints on shared cache keys and raised executor pool capacity.

Verification & CI Parity

  • make quick-check: Passed (Ruff, ESLint, TypeScript tsc --noEmit, OpenAPI freshness, migration chain validator).
  • Pytest Suite: All unit and integration suites passing.
  • Vitest Suite: 297 test files / 2,617 tests passed.
  • Deployment: Verified healthy on local environment (https://localhost).

- Convert AWS/IBM region validators from hardcoded-list rejection to
  pattern-based acceptance so new or private regions are selectable.
- Add Azure and GCP region validators using the same pattern-based
  approach; wire them into project, credential-template, and cluster
  schemas/routes.
- Update frontend region selectors (AWS, Cloud, SystemDefaults) to
  free-form inputs with datalist suggestions instead of restrictive
  dropdowns.
- Add KubernetesCluster.account_id and discovery_status columns plus
  fleet-health response fields for cloud context.
- Update unit tests for validators, project schemas, k8s schemas, and
  frontend selectors.
…ctor

- Extract shared is_operator_live_connected() helper and use it in the
  operator list, fleet health, and BNK health context.
- Reuse services.scanner.nodes.parse_node() in BNK fetch instead of
  duplicating the zone/instance-type label fallback logic.
- Add an optional label prop to CloudRegionSelector and reuse it in
  SystemDefaults to remove four near-identical region input blocks.
- Add connectivity and integration sections to BnkHealthResponse.
- Reuse the cluster's persisted status for connectivity and the shared
  operator live-connection helper for integration.
- Display ConnectivityBadge and IntegrationBadge in the dashboard banner.
- Add backend unit tests and frontend dashboard tests for the new fields.
Add /detect-credentials endpoint that discovers existing Kubernetes
clusters from a project's credential template for AWS, IBM Cloud,
Azure, and GCP. Each provider lists accessible clusters, builds a
kubeconfig from the template credentials, and registers the cluster
in BNK-Forge.

- New ClusterDiscoveryService orchestrates detection and registration.
- Provider helpers: EKS, ROKS, AKS, GKE.
- Frontend auto-detect switched to api.detectClustersFromCredentials().
- Backend + frontend tests updated; openapi.json and api-generated.ts
  regenerated.
- Move BNK Resources tab from System page to Fleet page
- Make GET /api/system/bnk-consumption viewer-accessible
- Move MCP Server from standalone sidebar page to System page tab
- Move Benchmarks sidebar item from OPERATE to OBSERVE section
- Update affected tests and regenerate OpenAPI types
- Add services/bnk/traffic_stats.py with analyze_traffic_stats() and
  fetch_tmm_traffic_stats() wrapping existing TMM debug helpers.
- Add Pydantic schemas for listener/egress/firewall-rule traffic stats.
- Wire trafficStats into the unified /f5bnk/data response.
- Surface hit/connection badges on F5BNKTopologyViewer listener/egress nodes.
- Add hits column to F5BNKPolicyViewer firewall-rule tables.
- Add total-connections summary chips in TrafficFlowOverview.
- Regenerate openapi.json and TypeScript generated types.
- Add backend unit tests and frontend component/hook tests.
- Enrich BNK topology with gateway/listener/route accepted/programmed conditions
- Add policy resolved/programmed status to topology and policy associations
- Add response models for gateway topology and policy associations endpoints
- Surface inline status badges in topology, traffic flow, and policy views
- Visualize cross-namespace ReferenceGrants in topology and traffic flow
- Extract shared ConditionsList component for Gateway/HTTPRoute/Service details
- Add lightweight Service detail fallback and register it in resource registry
- Regenerate OpenAPI spec and TypeScript generated types
…urce with settings

Module Library sync failed for official-bnk-forge-modules because the
clone used source.branch and then tried git checkout <git_ref>. A shallow
branch clone does not fetch tags, so checking out a tag ref (v2.2.0) failed
with 'pathspec did not match any file(s) known to git'.

Use source.git_ref (falling back to branch) directly in git clone --branch,
which accepts branch and tag names and already checks out the requested ref.

Also reconcile the canonical official module source with the current
module_library.git_* settings before a direct source sync, so a stale
branch/git_ref on the source row does not override the configured ref.

Validated: /api/module-sources/3/sync now succeeds, discovers 24 pack
modules, and updates the source row to branch=git_ref=release/2.2.
…d CNE available state

- Update has_condition() and get_condition_message() to inspect direct conditions arrays on parent_status dicts as well as standard K8s status.conditions.
- Add get_policy_operational_status() to evaluate status.ancestors and status.descendants condition refs for BNKNetPolicy and BNKSecPolicy in BNK 2.3.
- Update _build_cne_instance() to recognize Available/Reconciled condition states and populate default phase when healthy.
- Update _match_routes_to_listener() to check parent_status condition acceptance.
Stop per-request ThreadPoolExecutors from spawning 20 workers each, which
exploded backend PID count to 100+ under concurrent BNK page loads. Use
module-level shared executors with small caps for BNK CRD fetches and TMM
configview probes.

Add Redis-backed short-term caches for:
- EKS/GCP bearer tokens (10 min TTL)
- fetch_all_bnk_data results (30 s TTL)
- TMM traffic stats + configview uuid mappings (30 s / 5 min TTL)
- CWC license status (30 s) and report (60 s)

Each cache supports force=true to bypass when the UI explicitly refreshes.
License activation invalidates the cached status/report so the new state is
reflected immediately.
Add account_id, discovery_status, connectivity_status, integration_status,
zones, access_method, and node_count to the KubernetesCluster model, cluster
response schemas, serializers, and detail endpoints. Populate account_id from
credential-template discovery paths (AWS account, Azure subscription, GCP
project) and persist version/node_count/zones/last_synced_at from the scanner.

Includes migration v2_157 and a new GET /api/projects/{project_id}/connectivity
route backed by probe_project_clusters.
…uster

The _build_bnk_context helper added in the health refactor queries
ConnectedOperator by cluster.id. Tests that patched KubernetesService
returned a MagicMock cluster, causing a SQLite bind error. Configure the
mock to return the real test cluster so the endpoint can build its
connectivity/integration context.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant