Last active
November 4, 2017 00:24
-
-
Save pandeybk/4dd19bad7756aed46cea4f9b9004f4dc to your computer and use it in GitHub Desktop.
RBAC Kubernetes Using Service Account
This file contains hidden or 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: v1 | |
kind: Namespace | |
metadata: | |
name: goglides | |
--- | |
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
labels: | |
app: microservice | |
name: goglidescustomsa | |
namespace: goglides | |
--- | |
kind: Role | |
apiVersion: rbac.authorization.k8s.io/v1beta1 | |
metadata: | |
name: goglidedeployerrole | |
namespace: goglides | |
rules: | |
- apiGroups: ["apps"] | |
resources: ["deployments"] | |
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"] | |
- apiGroups: [""] # "" indicates the core API group | |
resources: ["configmaps", "secrets"] | |
verbs: ["get", "list", "watch", "create", "delete", "update", "patch"] | |
- apiGroups: [""] # "" indicates the core API group | |
resources: ["pods"] | |
verbs: ["get", "list", "watch"] | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1beta1 | |
kind: RoleBinding | |
metadata: | |
name: goglidedeployerrole | |
namespace: goglides | |
roleRef: | |
apiGroup: rbac.authorization.k8s.io | |
kind: Role | |
name: goglidedeployerrole | |
subjects: | |
- kind: ServiceAccount | |
name: goglidescustomsa | |
namespace: goglides |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment