clusterrole.yaml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. {{- if .Values.rbac.create }}
  2. {{- if and .Values.rbac.scope (not .Values.controller.scope.enabled) -}}
  3. {{ required "Invalid configuration: 'rbac.scope' should be equal to 'controller.scope.enabled' (true/false)." (index (dict) ".") }}
  4. {{- end }}
  5. {{- if not .Values.rbac.scope -}}
  6. apiVersion: rbac.authorization.k8s.io/v1
  7. kind: ClusterRole
  8. metadata:
  9. labels:
  10. {{- include "ingress-nginx.labels" . | nindent 4 }}
  11. {{- with .Values.controller.labels }}
  12. {{- toYaml . | nindent 4 }}
  13. {{- end }}
  14. name: {{ include "ingress-nginx.fullname" . }}
  15. rules:
  16. - apiGroups:
  17. - ""
  18. resources:
  19. - configmaps
  20. - endpoints
  21. - nodes
  22. - pods
  23. - secrets
  24. {{- if not .Values.controller.scope.enabled }}
  25. - namespaces
  26. {{- end}}
  27. verbs:
  28. - list
  29. - watch
  30. - apiGroups:
  31. - coordination.k8s.io
  32. resources:
  33. - leases
  34. verbs:
  35. - list
  36. - watch
  37. {{- if and .Values.controller.scope.enabled .Values.controller.scope.namespace }}
  38. - apiGroups:
  39. - ""
  40. resources:
  41. - namespaces
  42. resourceNames:
  43. - "{{ .Values.controller.scope.namespace }}"
  44. verbs:
  45. - get
  46. {{- end }}
  47. - apiGroups:
  48. - ""
  49. resources:
  50. - nodes
  51. verbs:
  52. - get
  53. - apiGroups:
  54. - ""
  55. resources:
  56. - services
  57. verbs:
  58. - get
  59. - list
  60. - watch
  61. - apiGroups:
  62. - networking.k8s.io
  63. resources:
  64. - ingresses
  65. verbs:
  66. - get
  67. - list
  68. - watch
  69. - apiGroups:
  70. - ""
  71. resources:
  72. - events
  73. verbs:
  74. - create
  75. - patch
  76. - apiGroups:
  77. - networking.k8s.io
  78. resources:
  79. - ingresses/status
  80. verbs:
  81. - update
  82. - apiGroups:
  83. - networking.k8s.io
  84. resources:
  85. - ingressclasses
  86. verbs:
  87. - get
  88. - list
  89. - watch
  90. - apiGroups:
  91. - discovery.k8s.io
  92. resources:
  93. - endpointslices
  94. verbs:
  95. - list
  96. - watch
  97. - get
  98. {{- end }}
  99. {{- end }}