Skip to content

Instantly share code, notes, and snippets.

@dwdraju
Created October 19, 2018 16:02
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save dwdraju/60fdffecae03440313922d0eaba56f9d to your computer and use it in GitHub Desktop.
Save dwdraju/60fdffecae03440313922d0eaba56f9d to your computer and use it in GitHub Desktop.
Kubernetes RBAC for Log Viewer
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: user-log-reader
namespace: default
rules:
- apiGroups:
- ""
resources:
- pods
- pods/log
verbs: ["get", "list"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: user-log-reader
namespace: default
subjects:
- kind: User
name: user@google-account.com
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: Role
name: user-log-reader
apiGroup: rbac.authorization.k8s.io
@duyetpt
Copy link

duyetpt commented Sep 4, 2020

Thanks you, it worked when change rbac.authorization.k8s.io/v1beta1 to rbac.authorization.k8s.io/v1 on gke.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment