pod-log-reader-role.yaml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. # Licensed to the Apache Software Foundation (ASF) under one
  2. # or more contributor license agreements. See the NOTICE file
  3. # distributed with this work for additional information
  4. # regarding copyright ownership. The ASF licenses this file
  5. # to you under the Apache License, Version 2.0 (the
  6. # "License"); you may not use this file except in compliance
  7. # with the License. You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing,
  12. # software distributed under the License is distributed on an
  13. # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. # KIND, either express or implied. See the License for the
  15. # specific language governing permissions and limitations
  16. # under the License.
  17. ################################
  18. ## Airflow Pod Reader Role
  19. #################################
  20. {{- if and .Values.rbac.create (or .Values.webserver.allowPodLogReading .Values.triggerer.enabled) }}
  21. {{- if .Values.multiNamespaceMode }}
  22. kind: ClusterRole
  23. {{- else }}
  24. kind: Role
  25. {{- end }}
  26. apiVersion: rbac.authorization.k8s.io/v1
  27. metadata:
  28. name: {{ .Release.Name }}-pod-log-reader-role
  29. {{- if not .Values.multiNamespaceMode }}
  30. namespace: "{{ .Release.Namespace }}"
  31. {{- end }}
  32. labels:
  33. tier: airflow
  34. release: {{ .Release.Name }}
  35. chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
  36. heritage: {{ .Release.Service }}
  37. {{- with .Values.labels }}
  38. {{ toYaml . | indent 4 }}
  39. {{- end }}
  40. rules:
  41. - apiGroups:
  42. - ""
  43. resources:
  44. - "pods"
  45. verbs:
  46. - "list"
  47. - "get"
  48. - "watch"
  49. - apiGroups:
  50. - ""
  51. resources:
  52. - "pods/log"
  53. verbs:
  54. - "get"
  55. - "list"
  56. {{- end }}