Skip to content

Commit

Permalink
fix: metrics rbac (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
raffis committed Jul 12, 2023
1 parent 000a796 commit 7054e1f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion chart/k8sdb-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ keywords:
name: k8sdb-controller
sources:
- https://github.com/DoodleScheduling/k8sdb-controller
version: 0.3.1
version: 0.3.2
2 changes: 1 addition & 1 deletion chart/k8sdb-controller/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ spec:
- --upstream=http://127.0.0.1:{{ .Values.metricsPort }}
- --logtostderr=true
- --v=0
image: quay.io/brancz/kube-rbac-proxy:v0.14.0
image: {{ .Values.kubeRBACProxy.image }}
imagePullPolicy: IfNotPresent
name: kube-rbac-proxy
ports:
Expand Down
18 changes: 18 additions & 0 deletions chart/k8sdb-controller/templates/metrics-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,24 @@ rules:
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "k8sdb-controller.fullname" . }}-metrics
labels:
app.kubernetes.io/name: {{ include "k8sdb-controller.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "k8sdb-controller.chart" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "k8sdb-controller.fullname" . }}-metrics-reader
subjects:
- kind: ServiceAccount
name: {{ template "k8sdb-controller.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "k8sdb-controller.fullname" . }}-proxy
labels:
Expand Down
2 changes: 1 addition & 1 deletion chart/k8sdb-controller/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ prometheusRule:

kubeRBACProxy:
enabled: true

image: quay.io/brancz/kube-rbac-proxy:v0.14.2
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand Down

0 comments on commit 7054e1f

Please sign in to comment.