clusterrole.yaml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. {{- if and .Values.rbac.create (empty .Values.server.useExistingClusterRoleName) -}}
  2. apiVersion: {{ template "rbac.apiVersion" . }}
  3. kind: ClusterRole
  4. metadata:
  5. labels:
  6. {{- include "prometheus.server.labels" . | nindent 4 }}
  7. name: {{ include "prometheus.clusterRoleName" . }}
  8. rules:
  9. {{- if and .Values.podSecurityPolicy.enabled (.Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy") }}
  10. - apiGroups:
  11. - extensions
  12. resources:
  13. - podsecuritypolicies
  14. verbs:
  15. - use
  16. resourceNames:
  17. - {{ template "prometheus.server.fullname" . }}
  18. {{- end }}
  19. - apiGroups:
  20. - ""
  21. resources:
  22. - nodes
  23. - nodes/proxy
  24. - nodes/metrics
  25. - services
  26. - endpoints
  27. - pods
  28. - ingresses
  29. - configmaps
  30. verbs:
  31. - get
  32. - list
  33. - watch
  34. - apiGroups:
  35. - "extensions"
  36. - "networking.k8s.io"
  37. resources:
  38. - ingresses/status
  39. - ingresses
  40. verbs:
  41. - get
  42. - list
  43. - watch
  44. - apiGroups:
  45. - "discovery.k8s.io"
  46. resources:
  47. - endpointslices
  48. verbs:
  49. - get
  50. - list
  51. - watch
  52. - nonResourceURLs:
  53. - "/metrics"
  54. verbs:
  55. - get
  56. {{- end }}