Frontend extensions
About 292 words
@spechtlabs/backstage-plugin-cilium is a plugin for Backstage's new frontend system, with the plugin ID cilium. Its default export is the plugin. It adds five extensions:
| Extension ID | Kind | What it adds | Shown for |
|---|---|---|---|
api:cilium | API | ciliumApiRef, implemented by CiliumClient | |
page:cilium | page | the policy console at /cilium, titled Network policy | |
entity-content:cilium/policy | entity content | the Network policy tab, at the entity's network-policy path | Cilium entities of spec.type: policy |
entity-card:cilium/rule | entity card (content) | the Network policy rule card: the rule, its problems, the flows it adds | Cilium entities of spec.type: rule |
entity-card:cilium/flows | entity card (content) | the Network policy card: what reaches the entity and what it reaches; renders nothing when no policy concerns it | Components, Resources and APIs |
Turn an extension off
Like any extension of the new frontend system, each one can be turned off or configured in app-config.yaml. To hide the flows card, for example:
app:
extensions:
- entity-card:cilium/flows: falseThe API
The package exports ciliumApiRef (ID plugin.cilium), the CiliumApi interface and its default implementation, CiliumClient:
interface CiliumApi {
getOverview(): Promise<Overview>;
}getOverview() calls GET /api/cilium/overview and keeps the result for a minute, since the page, the tab and every entity card read it. It uses the discovery and fetch APIs, so requests carry the signed-in user's token. The types come from @spechtlabs/backstage-plugin-cilium-common; see HTTP API.
Not supported
There is no export for the legacy frontend system (no createPlugin, no routable components to put in App.tsx). The frontend needs the backend plugin; without it, every view shows an error from /api/cilium.
