Skip to content

Commit

Permalink
fix: metrics rbac (#52)
Browse files Browse the repository at this point in the history
* fix: rbac metrics

* style: lint fix
  • Loading branch information
raffis committed Jul 12, 2023
1 parent 5000fa0 commit c1e1933
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion chart/k8s-pause/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ keywords:
name: k8s-pause
sources:
- https://github.com/DoodleScheduling/k8s-pause
version: 0.2.6
version: 0.2.7
2 changes: 1 addition & 1 deletion chart/k8s-pause/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,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/k8s-pause/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 "k8s-pause.fullname" . }}-metrics
labels:
app.kubernetes.io/name: {{ include "k8s-pause.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
helm.sh/chart: {{ include "k8s-pause.chart" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "k8s-pause.fullname" . }}-metrics-reader
subjects:
- kind: ServiceAccount
name: {{ template "k8s-pause.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "k8s-pause.fullname" . }}-proxy
labels:
Expand Down
8 changes: 7 additions & 1 deletion chart/k8s-pause/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,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 c1e1933

Please sign in to comment.