# cluster-permissions-docs
**Repository Path**: mirrors_elastic/cluster-permissions-docs
## Basic Information
- **Project Name**: cluster-permissions-docs
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: Apache-2.0
- **Default Branch**: main
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2024-09-17
- **Last Updated**: 2026-01-10
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# Cluster permissions documentation generator
This is a very primitive, one-shot, project to convert a file that contains `ClusterRole` into a markdown table.
## Usage
```
Usage of ./cluster-permissions-doc-generator:
-in string
path to a file which contains a ClusterRole rules. Only one ClusterRole is supported.
-out string
path to a file were the content should be written
```
## YAML Comments
It supports comments which precede a rule, for example:
```yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: my-role
rules:
#
- `Namespaces` are watched because...
# - `Nodes` are watched because...
# - `Endpoints` are watched because...
- apiGroups:
- ""
resources:
- endpoints
- namespaces
- nodes
verbs:
- get
- list
- watch
```
This would be converted into the following:
```markdown
| API Groups | Resources | Non Resource URLs | Resource Names | Verbs | Comment |
| ----------- | --------- | ----- | -------------- | ----------------- | ------- |
|||none|none||- `Namespaces` are watched because...
- `Nodes` are watched because...
- `Endpoints` are watched because...
|
```
And this would be displayed as:
| API Groups | Resources | Non Resource URLs | Resource Names | Verbs | Comment |
| ----------- | --------- | ----- | -------------- | ----------------- | ------- |
|||none|none||- `Namespaces` are watched because...
- `Nodes` are watched because...
- `Endpoints` are watched because...
|
If an output file is set using `-out` then the content is either:
* Added to the end of the file
* Updated between the markers `` and ``
## Limitations
* Template is hardcoded.
* Only one file can be provided.
* File must contain only one cluster role.