Last active
April 6, 2022 19:02
-
-
Save adrianescutia/6b5107f3e5f9cd96fbeb1f5390561c43 to your computer and use it in GitHub Desktop.
Role and RoleBinding for OpenShift (and Kubernetes) to get the pods and logs ONLY
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: Role | |
metadata: | |
name: logging-user:list-and-logs | |
namespace: YOUR-NAMESPACE | |
rules: | |
- apiGroups: | |
- '' | |
resources: | |
- pods | |
- pods/log | |
verbs: | |
- get | |
- watch | |
- list | |
- verbs: | |
- get | |
apiGroups: | |
- '' | |
resources: | |
- namespaces | |
- verbs: | |
- get | |
apiGroups: | |
- '' | |
- project.openshift.io | |
resources: | |
- projects | |
--- | |
kind: RoleBinding | |
apiVersion: rbac.authorization.k8s.io/v1 | |
metadata: | |
name: 'logging-user:logs' | |
namespace: YOUR-NAMESPACE | |
subjects: | |
- kind: User | |
apiGroup: rbac.authorization.k8s.io | |
name: logging-user | |
roleRef: | |
apiGroup: rbac.authorization.k8s.io | |
kind: Role | |
name: 'logging-user:list-and-logs' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment