Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion chart/templates/rbac/pod-launcher-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,20 @@ kind: Role
{{- end }}
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ .Release.Name }}-pod-launcher-role
{{- if not .Values.multiNamespaceMode }}
name: {{ .Release.Name }}-pod-launcher-role
namespace: "{{ .Release.Namespace }}"
{{- else }}
name: {{ .Release.Name }}-{{ .Release.Namespace }}-pod-launcher-role
{{- end }}
labels:
tier: airflow
release: {{ .Release.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
{{- if .Values.multiNamespaceMode }}
namespace: "{{ .Release.Namespace }}"
{{- end }}
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
Expand Down
10 changes: 8 additions & 2 deletions chart/templates/rbac/pod-launcher-rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,30 @@ apiVersion: rbac.authorization.k8s.io/v1
metadata:
{{- if not .Values.multiNamespaceMode }}
namespace: "{{ .Release.Namespace }}"
{{- end }}
name: {{ .Release.Name }}-pod-launcher-rolebinding
{{- else }}
name: {{ .Release.Name }}-{{ .Release.Namespace }}-pod-launcher-rolebinding
{{- end }}
labels:
tier: airflow
release: {{ .Release.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
{{- if .Values.multiNamespaceMode }}
namespace: "{{ .Release.Namespace }}"
{{- end }}
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
roleRef:
apiGroup: rbac.authorization.k8s.io
{{- if .Values.multiNamespaceMode }}
kind: ClusterRole
name: {{ .Release.Name }}-{{ .Release.Namespace }}-pod-launcher-role
{{- else }}
kind: Role
{{- end }}
name: {{ .Release.Name }}-pod-launcher-role
{{- end }}
subjects:
{{- if has .Values.executor $schedulerLaunchExecutors }}
- kind: ServiceAccount
Expand Down
7 changes: 6 additions & 1 deletion chart/templates/rbac/pod-log-reader-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,20 @@ kind: Role
{{- end }}
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ .Release.Name }}-pod-log-reader-role
{{- if not .Values.multiNamespaceMode }}
name: {{ .Release.Name }}-pod-log-reader-role
namespace: "{{ .Release.Namespace }}"
{{- else }}
name: {{ .Release.Name }}-{{ .Release.Namespace}}-pod-log-reader-role
{{- end }}
labels:
tier: airflow
release: {{ .Release.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
{{- if .Values.multiNamespaceMode }}
namespace: "{{ .Release.Namespace }}"
{{- end }}
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
Expand Down
10 changes: 8 additions & 2 deletions chart/templates/rbac/pod-log-reader-rolebinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,30 @@ apiVersion: rbac.authorization.k8s.io/v1
metadata:
{{- if not .Values.multiNamespaceMode }}
namespace: "{{ .Release.Namespace }}"
{{- end }}
name: {{ .Release.Name }}-pod-log-reader-rolebinding
{{- else }}
name: {{ .Release.Name }}-{{ .Release.Namespace }}-pod-log-reader-rolebinding
{{- end }}
labels:
tier: airflow
release: {{ .Release.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
{{- if .Values.multiNamespaceMode }}
namespace: "{{ .Release.Namespace }}"
{{- end }}
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
roleRef:
apiGroup: rbac.authorization.k8s.io
{{- if .Values.multiNamespaceMode }}
kind: ClusterRole
name: {{ .Release.Name }}-{{ .Release.Namespace }}-pod-log-reader-role
{{- else }}
kind: Role
{{- end }}
name: {{ .Release.Name }}-pod-log-reader-role
{{- end }}
subjects:
{{- if .Values.webserver.allowPodLogReading }}
- kind: ServiceAccount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,19 @@ kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
{{- if not .Values.multiNamespaceMode }}
name: {{ .Release.Name }}-scc-rolebinding
namespace: "{{ .Release.Namespace }}"
{{- else }}
name: {{ .Release.Name }}-{{ .Release.Namespace }}-scc-rolebinding
{{- end }}
name: {{ .Release.Name }}-scc-rolebinding
labels:
tier: airflow
release: {{ .Release.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
{{- if .Values.multiNamespaceMode }}
namespace: "{{ .Release.Namespace }}"
{{- end }}
{{- with .Values.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
Expand Down
6 changes: 6 additions & 0 deletions newsfragments/31613.fix.rst
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a separate newsfragements folder for the chart, look in chart/newfragments.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Helm chart only fix: `ClusterRole`s and `ClusterRoleBinding`s created when `multiNamespaceMode` is enabled now have unique names.
* `{{ .Release.Name }}-pod-launcher-role` has been renamed to `{{ .Release.Name }}-{{ .Release.Namespace }}-pod-launcher-role`
* `{{ .Release.Name }}-pod-launcher-rolebinding` has been renamed to `{{ .Release.Name }}-{{ .Release.Namespace }}-pod-launcher-rolebinding`
* `{{ .Release.Name }}-pod-log-reader-role` has been renamed to `{{ .Release.Name }}-{{ .Release.Namespace }}-pod-log-reader-role`
* `{{ .Release.Name }}-pod-log-reader-rolebinding` has been renamed to `{{ .Release.Name }}-{{ .Release.Namespace }}-pod-log-reader-rolebinding`
* `{{ .Release.Name }}-scc-rolebinding` has been renamed to `{{ .Release.Name }}-{{ .Release.Namespace }}-scc-rolebinding`