Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion chart/stable/searchlight/templates/user-roles.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,39 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: appscode:searchlight:edit
name: appscode:searchlight:admin
labels:
rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
- apiGroups:
- monitoring.appscode.com
resources:
- clusteralerts
- nodealerts
- podalerts
- incidents
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- incidents.monitoring.appscode.com
resources:
- acknowledgements
verbs:
- create
- delete
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: appscode:searchlight:edit
labels:
rbac.authorization.k8s.io/aggregate-to-edit: "true"
rules:
- apiGroups:
Expand Down
18 changes: 18 additions & 0 deletions docs/setup/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,24 @@ $ kubectl delete pods -n kube-system searchlight-operator-1987091405-ghj5b
pod "searchlight-operator-1987091405-ghj5b" deleted
```

## Configuring RBAC
Searchlight introduces the following Kubernetes objects:

| API Group | Kinds |
|-----------------------------------|-------------------|
| monitoring.appscode.com | `ClusterAlert`<br/>`NodeAlert`<br/>`PodAlert`<br/>`Incident` |
| incidents.monitoring.appscode.com | `Acknowledgement` |

Searchlight installer will create 3 user facing cluster roles:

| ClusterRole | Aggregates To | Desription |
|---------------------------|---------------|---------------------------------------|
| appscode:searchlight:edit | admin | Allows admin access to Searchlight objects, intended to be granted within a namespace using a RoleBinding. This grants ability to create incidents manually.|
| appscode:searchlight:edit | edit | Allows edit access to Searchlight objects, intended to be granted within a namespace using a RoleBinding. |
| appscode:searchlight:view | view | Allows read-only access to Searchlight objects, intended to be granted within a namespace using a RoleBinding. |

These user facing roles supports [ClusterRole Aggregation](https://kubernetes.io/docs/admin/authorization/rbac/#aggregated-clusterroles) feature in Kubernetes 1.9 or later clusters.

## Using kubectl
```console
# List all Searchlight objects
Expand Down
32 changes: 31 additions & 1 deletion hack/deploy/user-roles.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,39 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: appscode:searchlight:edit
name: appscode:searchlight:admin
labels:
rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
- apiGroups:
- monitoring.appscode.com
resources:
- clusteralerts
- nodealerts
- podalerts
- incidents
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- incidents.monitoring.appscode.com
resources:
- acknowledgements
verbs:
- create
- delete
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: appscode:searchlight:edit
labels:
rbac.authorization.k8s.io/aggregate-to-edit: "true"
rules:
- apiGroups:
Expand Down