Skip to content

Commit 7054e1f

Browse files
authored
fix: metrics rbac (#43)
1 parent 000a796 commit 7054e1f

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

chart/k8sdb-controller/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ keywords:
1212
name: k8sdb-controller
1313
sources:
1414
- https://github.com/DoodleScheduling/k8sdb-controller
15-
version: 0.3.1
15+
version: 0.3.2

chart/k8sdb-controller/templates/deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ spec:
8888
- --upstream=http://127.0.0.1:{{ .Values.metricsPort }}
8989
- --logtostderr=true
9090
- --v=0
91-
image: quay.io/brancz/kube-rbac-proxy:v0.14.0
91+
image: {{ .Values.kubeRBACProxy.image }}
9292
imagePullPolicy: IfNotPresent
9393
name: kube-rbac-proxy
9494
ports:

chart/k8sdb-controller/templates/metrics-rbac.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,24 @@ rules:
1616
---
1717
apiVersion: rbac.authorization.k8s.io/v1
1818
kind: ClusterRoleBinding
19+
metadata:
20+
name: {{ include "k8sdb-controller.fullname" . }}-metrics
21+
labels:
22+
app.kubernetes.io/name: {{ include "k8sdb-controller.name" . }}
23+
app.kubernetes.io/instance: {{ .Release.Name }}
24+
app.kubernetes.io/managed-by: {{ .Release.Service }}
25+
helm.sh/chart: {{ include "k8sdb-controller.chart" . }}
26+
roleRef:
27+
apiGroup: rbac.authorization.k8s.io
28+
kind: ClusterRole
29+
name: {{ include "k8sdb-controller.fullname" . }}-metrics-reader
30+
subjects:
31+
- kind: ServiceAccount
32+
name: {{ template "k8sdb-controller.serviceAccountName" . }}
33+
namespace: {{ .Release.Namespace }}
34+
---
35+
apiVersion: rbac.authorization.k8s.io/v1
36+
kind: ClusterRoleBinding
1937
metadata:
2038
name: {{ include "k8sdb-controller.fullname" . }}-proxy
2139
labels:

chart/k8sdb-controller/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ prometheusRule:
122122

123123
kubeRBACProxy:
124124
enabled: true
125-
125+
image: quay.io/brancz/kube-rbac-proxy:v0.14.2
126126
securityContext:
127127
allowPrivilegeEscalation: false
128128
capabilities:

0 commit comments

Comments
 (0)