Installing the Kyverno Policy Reports Frontend Plugin#
This guide will help you install and set up the Kyverno Policy Reports frontend plugin in your Backstage instance.
Prerequisites#
Before installing the plugin, ensure you have:
- A working Backstage instance
- Kyverno installed in your Kubernetes cluster(s)
- (Optional) The Kyverno Permissions backend plugin installed
Installation Steps#
1. Add the Package#
Install the plugin package using yarn:
2. Import Components#
Add the necessary imports to your Entity Page file (typically packages/app/src/components/catalog/EntityPage.tsx
):
import {
KyvernoPolicyReportsTable,
KyvernoOverviewCard,
// Optional: For Crossplane integration
KyvernoCrossplanePolicyReportsTable,
KyvernoCrossplaneOverviewCard
} from '@terasky/backstage-plugin-kyverno-policy-reports';
3. Add to Entity Page#
Basic Setup#
Add the Kyverno components to your entity page:
const overviewContent = (
<Grid container spacing={3} alignItems="stretch">
{/* ... other grid items ... */}
<EntitySwitch>
<EntitySwitch.Case if={isKubernetesAvailable}>
<Grid item md={6}>
<KyvernoOverviewCard />
</Grid>
</EntitySwitch.Case>
</EntitySwitch>
{/* ... other grid items ... */}
</Grid>
);
const serviceEntityPage = (
<EntityLayout>
{/* ... other routes ... */}
<EntityLayout.Route path="/kyverno-policy-reports" title="Kyverno Policy Reports">
<KyvernoPolicyReportsTable />
</EntityLayout.Route>
{/* ... other routes ... */}
</EntityLayout>
);
Crossplane Integration (Optional)#
If you're using Crossplane, add the Crossplane-specific components:
const crossplaneOverviewContent = (
<Grid container spacing={3} alignItems="stretch">
{/* ... other grid items ... */}
<EntitySwitch>
<EntitySwitch.Case if={isKubernetesAvailable}>
<Grid item md={6}>
<KyvernoCrossplaneOverviewCard />
</Grid>
</EntitySwitch.Case>
</EntitySwitch>
{/* ... other grid items ... */}
</Grid>
);
const crossplaneEntityPage = (
<EntityLayout>
{/* ... other routes ... */}
<EntityLayout.Route path="/kyverno-policy-reports" title="Kyverno Policy Reports">
<KyvernoCrossplanePolicyReportsTable />
</EntityLayout.Route>
{/* ... other routes ... */}
</EntityLayout>
);
Verification#
After installation, verify that:
- The plugin appears in your package.json dependencies
- The Kyverno overview card appears on component pages
- The policy reports tab is accessible
- Policy data is being properly displayed
Troubleshooting#
Common issues and solutions:
-
Missing Overview Card
- Ensure the component is properly imported
- Check if
isKubernetesAvailable
returns true - Verify the grid layout configuration
-
No Policy Data
- Confirm Kyverno is running in your cluster
- Check if policy reports are being generated
- Verify permissions if using the backend plugin
For configuration options and customization, proceed to the Configuration Guide.