Merge pull request #27499 from dzemanov/add-kubernetes-permission
feat(kubernetes): introduce kubernetes permission
This commit is contained in:
@@ -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.',
|
||||
},
|
||||
}),
|
||||
]
|
||||
},
|
||||
...
|
||||
|
||||
@@ -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` |
|
||||
Reference in New Issue
Block a user