Skip to content

Commit

Permalink
fix: metrics rbac (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
raffis authored Jul 11, 2023
1 parent 9610d0d commit f39a4d7
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion chart/k8svault-controller/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ keywords:
name: k8svault-controller
sources:
- https://github.com/DoodleScheduling/k8svault-controller
version: 0.2.3
version: 0.2.4
2 changes: 1 addition & 1 deletion chart/k8svault-controller/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,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/k8svault-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 "k8svault-controller.fullname" . }}-metrics
labels:
app.kubernetes.io/name: {{ include "k8svault-controller.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "k8svault-controller.chart" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "k8svault-controller.fullname" . }}-metrics-reader
subjects:
- kind: ServiceAccount
name: {{ template "k8svault-controller.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "k8svault-controller.fullname" . }}-proxy
labels:
Expand Down
8 changes: 7 additions & 1 deletion chart/k8svault-controller/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,19 @@ prometheusRule:

kubeRBACProxy:
enabled: true

image: quay.io/brancz/kube-rbac-proxy:v0.14.2
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop: ["all"]
readOnlyRootFilesystem: true

resources: {}
# limits:
# cpu: 500m
# memory: 128Mi
# requests:
# cpu: 5m
# memory: 64Mi

tolerations: []

0 comments on commit f39a4d7

Please sign in to comment.