Merge pull request #27499 from dzemanov/add-kubernetes-permission

feat(kubernetes): introduce kubernetes permission
This commit is contained in:
Ben Lambert
2025-02-04 13:10:16 +01:00
committed by GitHub
25 changed files with 594 additions and 134 deletions
+18 -2
View File
@@ -80,11 +80,13 @@ The default value is `false`.
#### Internationalization
To customize or translate the **Delete Pod** text, use the following approach:
To customize or translate text in some of the components, use the following approach:
```js
import { createTranslationMessages } from '@backstage/core-plugin-api/alpha';
import { kubernetesReactTranslationRef } from '@backstage/plugin-kubernetes-react/alpha';
import { kubernetesTranslationRef } from '@backstage/plugin-kubernetes/alpha';
import { kubernetesClusterTranslationRef } from '@backstage/plugin-kubernetes-cluster/alpha';
const app = createApp({
__experimentalTranslations: {
@@ -94,7 +96,21 @@ const app = createApp({
messages: {
"podDrawer.buttons.delete": 'Restart Pod'
}
})
}),
createTranslationMessages({
ref: kubernetesTranslationRef,
messages: {
'kubernetesContentPage.permissionAlert.title': 'Insufficient permissions',
'kubernetesContentPage.permissionAlert.message': 'You do not have permissions to view Kubernetes objects.',
},
}),
createTranslationMessages({
ref: kubernetesClusterTranslationRef,
messages: {
'kubernetesClusterContentPage.permissionAlert.title': 'Insufficient permissions',
'kubernetesClusterContentPage.permissionAlert.message': 'You do not have permissions to view Kubernetes objects.',
},
}),
]
},
...
+18
View File
@@ -0,0 +1,18 @@
---
id: permissions
title: Permissions
description: Configuring permissions for Kubernetes plugin
---
The Kubernetes plugin integrates with the permission framework. Administrators can define PermissionPolicies
to restrict access to the `/clusters`, `/services/:serviceId`, `/resources` and `/proxy` endpoints.
This feature assumes your Backstage instance has enabled the [permissions framework](https://backstage.io/docs/permissions/getting-started).
### Available permissions
| Name | Policy | Description |
| ------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| kubernetes.clusters.read | read | Allows the user to read Kubernetes clusters information under `/clusters` |
| kubernetes.resources.read | read | Allows the user to read Kubernetes resources information under `/services/:serviceId` and `/resources` |
| kubernetes.proxy | | Allows the user to make arbitrary requests to the [REST API](https://kubernetes.io/docs/reference/using-api/api-concepts/) under `/proxy` |