Skip to content

Instantly share code, notes, and snippets.

@alothings
Created September 28, 2018 20:13
Show Gist options
  • Save alothings/eff42a3a33834e16cf0321886ec2c826 to your computer and use it in GitHub Desktop.
Save alothings/eff42a3a33834e16cf0321886ec2c826 to your computer and use it in GitHub Desktop.
serviceaccount.yaml
apiVersion: v1
imagePullSecrets:
- name: some-secret
kind: ServiceAccount
metadata:
name: devops-sa
namespace: devops
----
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: jenkins-role
namespace: devops
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["create","delete","get","list","patch","update","watch"]
- apiGroups: [""]
resources: ["pods/exec"]
verbs: ["create","delete","get","list","patch","update","watch"]
- apiGroups: [""]
resources: ["pods/log"]
verbs: ["get","list","watch"]
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get"]
----
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: jenkins-role-binding
namespace: devops
subjects:
- kind: ServiceAccount
name: devops-sa
namespace: devops
roleRef:
kind: Role
name: jenkins-role
apiGroup: rbac.authorization.k8s.io
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment