001-workflow-acount.yaml 854 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. apiVersion: v1
  2. kind: ServiceAccount
  3. metadata:
  4. name: workflow
  5. ---
  6. apiVersion: rbac.authorization.k8s.io/v1
  7. kind: Role
  8. metadata:
  9. name: workflow-role
  10. rules:
  11. # pod get/watch is used to identify the container IDs of the current pod
  12. # pod patch is used to annotate the step's outputs back to controller (e.g. artifact location)
  13. - apiGroups:
  14. - ""
  15. resources:
  16. - pods
  17. verbs:
  18. - get
  19. - watch
  20. - patch
  21. # logs get/watch are used to get the pods logs for script outputs, and for log archival
  22. - apiGroups:
  23. - ""
  24. resources:
  25. - pods/log
  26. verbs:
  27. - get
  28. - watch
  29. ---
  30. apiVersion: rbac.authorization.k8s.io/v1
  31. kind: RoleBinding
  32. metadata:
  33. name: workflow-binding
  34. roleRef:
  35. apiGroup: rbac.authorization.k8s.io
  36. kind: Role
  37. name: workflow-role
  38. subjects:
  39. - kind: ServiceAccount
  40. name: workflow