Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.runScope.cluster -}}
{{- if and .Values.runScope.cluster (not .Values.useExistingRole) -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand All @@ -21,4 +21,4 @@ rules:
- pods
verbs:
- list
{{- end -}}
{{- end -}}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.runScope.local -}}
{{- if and .Values.runScope.local (not .Values.useExistingRole) -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
Expand All @@ -22,4 +22,4 @@ rules:
- pods
verbs:
- list
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
@@ -1,20 +1,52 @@
{{- if .Values.runScope.local -}}
{{- if empty .Values.runScope.namespaces -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
app: {{ template "prometheus-container-resource-exporter.name" . }}
chart: {{ template "prometheus-container-resource-exporter.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
name: {{ template "prometheus-container-resource-exporter.fullname" . }}
namespace: {{ .Release.Namespace }}
app: {{ template "prometheus-container-resource-exporter.name" $ }}
chart: {{ template "prometheus-container-resource-exporter.chart" $ }}
release: {{ $.Release.Name }}
heritage: {{ $.Release.Service }}
name: {{ template "prometheus-container-resource-exporter.fullname" $ }}
namespace: {{ $.Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
{{- if (not .Values.useExistingRole) }}
name: {{ template "prometheus-container-resource-exporter.fullname" . }}
{{- else }}
name: {{ .Values.useExistingRole }}
{{- end }}
subjects:
- kind: ServiceAccount
name: {{ template "prometheus-container-resource-exporter.serviceAccountName" $ }}
namespace: {{ $.Release.Namespace }}
{{- else }}
{{- range $.Values.runScope.namespaces }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
app: {{ template "prometheus-container-resource-exporter.name" $ }}
chart: {{ template "prometheus-container-resource-exporter.chart" $ }}
release: {{ $.Release.Name }}
heritage: {{ $.Release.Service }}
name: {{ template "prometheus-container-resource-exporter.fullname" $ }}
namespace: {{ . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
{{- if (not $.Values.useExistingRole) }}
name: {{ template "prometheus-container-resource-exporter.fullname" $ }}
{{- else }}
name: {{ $.Values.useExistingRole }}
{{- end }}
subjects:
- kind: ServiceAccount
name: {{ template "prometheus-container-resource-exporter.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end -}}
name: {{ template "prometheus-container-resource-exporter.serviceAccountName" $ }}
namespace: {{ $.Release.Namespace }}
{{- end -}}
{{- end -}}
{{- end -}}
3 changes: 3 additions & 0 deletions helm-chart/prometheus-container-resource-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
runScope:
local: true
cluster: false
# add list of namespaces for this instance to collect from - if you have set runScope.local = true
# - otherwise it only collects from current namespace
namespaces: []

replicaCount: 1

Expand Down