Skip to content

Instantly share code, notes, and snippets.

@Odilhao
Created December 17, 2019 21:39
Show Gist options
  • Save Odilhao/c7259df1510b6b6ebb0a52aa61b341bc to your computer and use it in GitHub Desktop.
Save Odilhao/c7259df1510b6b6ebb0a52aa61b341bc to your computer and use it in GitHub Desktop.
Gitlab Runner RBAC and SA
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: gitlab-runner
namespace: gitlab
rules:
- apiGroups: [""]
resources: ["pods", "pods/exec", "secrets"]
verbs: ["get", "list", "watch", "create", "patch", "delete"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: gitlab-runner
namespace: gitlab
subjects:
- kind: ServiceAccount
name: gitlab-runner
namespace: default
roleRef:
kind: Role
name: gitlab-runner
apiGroup: rbac.authorization.k8s.io
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment