diff --git a/README.md b/README.md index 64ee8e8..4cd315a 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Adds a **Polaris** top-level sidebar section to Headlamp with the following view - **Namespace detail** -- per-namespace score, check counts, and a resource table showing pass/warning/danger per workload - **External link** -- quick jump to the native Polaris dashboard via the Kubernetes service proxy (from namespace detail view) -Data is fetched from the Polaris dashboard API through the Kubernetes service proxy (`/api/v1/namespaces/polaris/services/polaris-dashboard:80/proxy/results.json`). The plugin is read-only -- it never writes to the cluster. +Data is fetched from the Polaris dashboard API through the Kubernetes service proxy (`/api/v1/namespaces/polaris/services/polaris-dashboard/proxy/results.json`). The plugin is read-only -- it never writes to the cluster. Results are refreshed on a user-configurable interval (1 / 5 / 10 / 30 minutes, default 5). The setting is available in **Settings > Plugins > Polaris** and persists in the browser's localStorage. @@ -204,7 +204,7 @@ vitest.config.mts -- Vitest configuration (jsdom environment The plugin fetches live audit results from the Polaris dashboard HTTP API via the Kubernetes service proxy: ``` -GET /api/v1/namespaces/polaris/services/polaris-dashboard:80/proxy/results.json +GET /api/v1/namespaces/polaris/services/polaris-dashboard/proxy/results.json ``` This endpoint is served by the `polaris-dashboard` ClusterIP service, which is created by the Polaris Helm chart when `dashboard.enabled: true`. The JSON response matches Polaris's `AuditData` schema (`pkg/validator/output.go`): diff --git a/claude.md b/claude.md index 333c417..f5ff6dd 100644 --- a/claude.md +++ b/claude.md @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## Project Overview -Headlamp plugin that surfaces Fairwinds Polaris audit results inside the Headlamp UI. Queries the Polaris dashboard API via the Kubernetes service proxy (`/api/v1/namespaces/polaris/services/polaris-dashboard:80/proxy/results.json`). Target Headlamp ≥ v0.26. +Headlamp plugin that surfaces Fairwinds Polaris audit results inside the Headlamp UI. Queries the Polaris dashboard API via the Kubernetes service proxy (`/api/v1/namespaces/polaris/services/polaris-dashboard/proxy/results.json`). Target Headlamp ≥ v0.26. ## Build & Development Commands @@ -50,7 +50,7 @@ Top-level sidebar section at `/polaris` with sub-routes for namespaces list (`/p ## Security / RBAC Requirements -The plugin reaches Polaris through the Kubernetes API server's service proxy sub-resource (`/api/v1/namespaces/polaris/services/polaris-dashboard:80/proxy/...`). The Headlamp service account (or the user's bearer token when Headlamp runs in token-auth mode) must be granted: +The plugin reaches Polaris through the Kubernetes API server's service proxy sub-resource (`/api/v1/namespaces/polaris/services/polaris-dashboard/proxy/...`). The Headlamp service account (or the user's bearer token when Headlamp runs in token-auth mode) must be granted: | Verb | API Group | Resource | Resource Name | Namespace | |------|-----------|----------|---------------|-----------| diff --git a/src/api/polaris.ts b/src/api/polaris.ts index 3f65fd7..92deee4 100644 --- a/src/api/polaris.ts +++ b/src/api/polaris.ts @@ -146,7 +146,7 @@ export function setRefreshInterval(seconds: number): void { // --- Polaris dashboard proxy URL --- export const POLARIS_DASHBOARD_PROXY = - '/api/v1/namespaces/polaris/services/polaris-dashboard:80/proxy/'; + '/api/v1/namespaces/polaris/services/polaris-dashboard/proxy/'; // --- Score computation --- @@ -158,7 +158,7 @@ export function computeScore(counts: ResultCounts): number { // --- Data fetching hook --- const POLARIS_API_PATH = - '/api/v1/namespaces/polaris/services/polaris-dashboard:80/proxy/results.json'; + '/api/v1/namespaces/polaris/services/polaris-dashboard/proxy/results.json'; interface PolarisDataState { data: AuditData | null;