Skip to content

Instantly share code, notes, and snippets.

@tristanlins
Created January 19, 2020 12:45
Show Gist options
  • Save tristanlins/5c1b31989a308db77320f109069fde50 to your computer and use it in GitHub Desktop.
Save tristanlins/5c1b31989a308db77320f109069fde50 to your computer and use it in GitHub Desktop.
Medium | Gitlab ServiceAccount with RBAC
apiVersion: v1
kind: ServiceAccount
metadata:
name: gitlab
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: pod-manager
rules:
- apiGroups: ["apps"]
resources: ["deployments"]
verbs: ["get", "list", "watch", "patch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: manage-pods
subjects:
- kind: ServiceAccount
name: gitlab
roleRef:
kind: Role
name: pod-manager
apiGroup: rbac.authorization.k8s.io
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment