Skip to content

Instantly share code, notes, and snippets.

@antoinemartin
Created March 2, 2019 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antoinemartin/1ef51645d9b55f0e445febb77973a9bf to your computer and use it in GitHub Desktop.
Save antoinemartin/1ef51645d9b55f0e445febb77973a9bf to your computer and use it in GitHub Desktop.
Add API read rights to default K8S service account
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: pod-reader
namespace: default
rules:
- apiGroups: [ "" ]
resources: [ "pods", "services"]
verbs: [ "get", "list", "watch"]
- apiGroups: [ "extensions" ]
resources: [ "deployments" ]
verbs: [ "get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: default-pod-reader
namespace: default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: pod-reader
subjects:
- kind: ServiceAccount
name: default
namespace: default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment