Skip to content

Instantly share code, notes, and snippets.

@dcberg
Last active June 1, 2017 04:01
Show Gist options
  • Save dcberg/0ae9b50cb2a94a18dc69c80dbb7c4d60 to your computer and use it in GitHub Desktop.
Save dcberg/0ae9b50cb2a94a18dc69c80dbb7c4d60 to your computer and use it in GitHub Desktop.
Kubernetes rbac file with read/write access for weave-works scope using the v1alpha1 format for rbac.
# Read/write permissions and roles for weave-scope
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1alpha1
metadata:
name: weave-scope-mgr
rules:
- apiGroups: [""]
resources: ["services", "replicationcontrollers", "namesapces", "nodes", "daemonsets"]
verbs: ["get", "list", "watch"]
- apiGroups: ["extensions"]
resources: ["deployments", "replicasets", "deployments.extensions", "replicasets.extensions", "deployments/scale", "deployments/rollback", "deployments/status", "replicasets/scale", "replicasets/rollback", "replicasets/status"]
verbs: ["get", "list", "watch", "update", "patch"]
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list", "watch", "delete", "update", "patch"]
- nonResourceURLs: ["*"]
verbs: ["*"]
---
# Grant permissions to weave-scope in the kube-system namespace.
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1alpha1
metadata:
name: weave-scope-mgr-role-binding
subjects:
- kind: ServiceAccount
name: weave-scope
namespace: kube-system
roleRef:
kind: ClusterRole
name: weave-scope-mgr
apiGroup: rbac.authorization.k8s.io
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment