clusterrolebinding.j2 592 B

123456789101112131415161718192021222324252627282930
  1. apiVersion: v1
  2. kind: ClusterRoleBinding
  3. metadata:
  4. name: {{obj_name}}
  5. {% if labels is defined%}
  6. labels:
  7. {% for key, value in labels.items() %}
  8. {{key}}: {{value}}
  9. {% endfor %}
  10. {% endif %}
  11. {% if crb_usernames is defined %}
  12. userNames:
  13. {% for name in crb_usernames %}
  14. - {{ name }}
  15. {% endfor %}
  16. {% endif %}
  17. {% if crb_groupnames is defined %}
  18. groupNames:
  19. {% for name in crb_groupnames %}
  20. - {{ name }}
  21. {% endfor %}
  22. {% endif %}
  23. subjects:
  24. {% for sub in subjects %}
  25. - kind: {{ sub.kind }}
  26. name: {{ sub.name }}
  27. namespace: {{sub.namespace}}
  28. {% endfor %}
  29. roleRef:
  30. name: {{cr_name}}