From f39a4d7d5240c56ccf6aa174ab36459eff629bdb Mon Sep 17 00:00:00 2001 From: raffis Date: Tue, 11 Jul 2023 16:38:26 +0200 Subject: [PATCH] fix: metrics rbac (#25) --- chart/k8svault-controller/Chart.yaml | 2 +- .../templates/deployment.yaml | 2 +- .../templates/metrics-rbac.yaml | 18 ++++++++++++++++++ chart/k8svault-controller/values.yaml | 8 +++++++- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/chart/k8svault-controller/Chart.yaml b/chart/k8svault-controller/Chart.yaml index 977ca7f..b61594e 100644 --- a/chart/k8svault-controller/Chart.yaml +++ b/chart/k8svault-controller/Chart.yaml @@ -12,4 +12,4 @@ keywords: name: k8svault-controller sources: - https://github.com/DoodleScheduling/k8svault-controller -version: 0.2.3 +version: 0.2.4 diff --git a/chart/k8svault-controller/templates/deployment.yaml b/chart/k8svault-controller/templates/deployment.yaml index ffb9f2d..f24dfb9 100644 --- a/chart/k8svault-controller/templates/deployment.yaml +++ b/chart/k8svault-controller/templates/deployment.yaml @@ -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: diff --git a/chart/k8svault-controller/templates/metrics-rbac.yaml b/chart/k8svault-controller/templates/metrics-rbac.yaml index 4afacfc..c15be39 100644 --- a/chart/k8svault-controller/templates/metrics-rbac.yaml +++ b/chart/k8svault-controller/templates/metrics-rbac.yaml @@ -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: diff --git a/chart/k8svault-controller/values.yaml b/chart/k8svault-controller/values.yaml index 882d4f6..e7a47a9 100644 --- a/chart/k8svault-controller/values.yaml +++ b/chart/k8svault-controller/values.yaml @@ -133,7 +133,7 @@ prometheusRule: kubeRBACProxy: enabled: true - + image: quay.io/brancz/kube-rbac-proxy:v0.14.2 securityContext: allowPrivilegeEscalation: false capabilities: @@ -141,5 +141,11 @@ kubeRBACProxy: readOnlyRootFilesystem: true resources: {} + # limits: + # cpu: 500m + # memory: 128Mi + # requests: + # cpu: 5m + # memory: 64Mi tolerations: []