{{- if .Values.reporting }} {{- if .Values.reporting.logCollection }} apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: {{ template "cost-analyzer.serviceAccountName" . }} namespace: {{ .Release.Namespace }} labels: {{ include "cost-analyzer.commonLabels" . | nindent 4 }} roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: {{ template "cost-analyzer.serviceAccountName" . }} subjects: - kind: ServiceAccount name: {{ template "cost-analyzer.serviceAccountName" . }} namespace: {{ .Release.Namespace }} --- {{- end }} {{- end }} {{- if (not .Values.kubecostModel.etlReadOnlyMode) }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: {{ template "cost-analyzer.serviceAccountName" . }} labels: {{ include "cost-analyzer.commonLabels" . | nindent 4 }} roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: {{ template "cost-analyzer.serviceAccountName" . }} subjects: - kind: ServiceAccount name: {{ template "cost-analyzer.serviceAccountName" . }} namespace: {{ .Release.Namespace }} {{- end }}