diff --git a/stable/prometheus-adapter/Chart.yaml b/stable/prometheus-adapter/Chart.yaml index 8ad9569d93..41ac38764b 100644 --- a/stable/prometheus-adapter/Chart.yaml +++ b/stable/prometheus-adapter/Chart.yaml @@ -1,5 +1,5 @@ name: prometheus-adapter -version: v0.2.3 +version: v0.3.0 appVersion: v0.4.1 description: A Helm chart for k8s prometheus adapter home: https://github.com/DirectXMan12/k8s-prometheus-adapter diff --git a/stable/prometheus-adapter/README.md b/stable/prometheus-adapter/README.md index 5d8db54a84..62fe3872a1 100644 --- a/stable/prometheus-adapter/README.md +++ b/stable/prometheus-adapter/README.md @@ -49,6 +49,7 @@ The following table lists the configurable parameters of the Prometheus Adapter | `resources` | CPU/Memory resource requests/limits | `{}` | | `rules.default` | If `true`, enable a set of default rules in the configmap | `true` | | `rules.custom` | A list of custom configmap rules | `[]` | +| `rules.existing` | The name of an existing configMap with rules. Overrides default and custom. | `` | | `service.annotations` | Annotations to add to the service | `{}` | | `service.port` | Service port to expose | `443` | | `service.type` | Type of service to create | `ClusterIP` | diff --git a/stable/prometheus-adapter/templates/custom-metrics-apiserver-deployment.yaml b/stable/prometheus-adapter/templates/custom-metrics-apiserver-deployment.yaml index 26aaed9e0e..4321fc5a30 100644 --- a/stable/prometheus-adapter/templates/custom-metrics-apiserver-deployment.yaml +++ b/stable/prometheus-adapter/templates/custom-metrics-apiserver-deployment.yaml @@ -95,7 +95,11 @@ spec: volumes: - name: config configMap: + {{- if .Values.rules.existing }} + name: {{ .Values.rules.existing }} + {{- else }} name: {{ template "k8s-prometheus-adapter.fullname" . }} + {{- end }} - name: tmp emptyDir: {} {{- if .Values.tls.enable }} diff --git a/stable/prometheus-adapter/templates/custom-metrics-configmap.yaml b/stable/prometheus-adapter/templates/custom-metrics-configmap.yaml index e267861111..e30aefd8f5 100644 --- a/stable/prometheus-adapter/templates/custom-metrics-configmap.yaml +++ b/stable/prometheus-adapter/templates/custom-metrics-configmap.yaml @@ -1,3 +1,4 @@ +{{- if not .Values.rules.existing -}} apiVersion: v1 kind: ConfigMap metadata: @@ -81,4 +82,4 @@ data: {{- if .Values.rules.custom }} {{ toYaml .Values.rules.custom | indent 4 }} {{- end -}} - +{{- end -}} \ No newline at end of file diff --git a/stable/prometheus-adapter/values.yaml b/stable/prometheus-adapter/values.yaml index f91f200eec..070bc462d2 100644 --- a/stable/prometheus-adapter/values.yaml +++ b/stable/prometheus-adapter/values.yaml @@ -48,6 +48,9 @@ rules: # matches: "" # as: "my_custom_metric" # metricsQuery: sum(<<.Series>>{<<.LabelMatchers>>}) by (<<.GroupBy>>) + # Mounts a configMap with pre-generated rules for use. Overrides the + # default and custom entries + existing: service: annotations: {}