Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RBAC policy example #4

Open
AndrewDryga opened this issue Jun 5, 2017 · 1 comment
Open

Add RBAC policy example #4

AndrewDryga opened this issue Jun 5, 2017 · 1 comment

Comments

@AndrewDryga
Copy link

AndrewDryga commented Jun 5, 2017

Never Kubernetes releases enable RBAC by default, which means that this pod won't be able to requests API unless policy is created.

It would be nice to have an example of role and rolebinding.

@AndrewDryga
Copy link
Author

Example policy that works on our cluster:

kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  namespace: monitoring
  name: slack-events-watcher
rules:
- apiGroups: [""] # "" indicates the core API group
  resources: ["events"]
  verbs: ["list", "watch", "get"]

---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
  namespace: monitoring
  name: watch-events
subjects:
- kind: ServiceAccount
  name: default
  namespace: monitoring
  apiGroup: ""
roleRef:
  kind: ClusterRole
  name: slack-events-watcher
  apiGroup: rbac.authorization.k8s.io

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant