diff --git a/charts/prom-aggregation-gateway/Chart.yaml b/charts/prom-aggregation-gateway/Chart.yaml index f693580..e2d1089 100644 --- a/charts/prom-aggregation-gateway/Chart.yaml +++ b/charts/prom-aggregation-gateway/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: prom-aggregation-gateway -version: 0.6.1 +version: 0.6.2 home: https://github.com/zapier/prom-aggregation-gateway maintainers: - name: djeebus diff --git a/charts/prom-aggregation-gateway/templates/_helpers.tpl b/charts/prom-aggregation-gateway/templates/_helpers.tpl index c84c3e0..57e1030 100644 --- a/charts/prom-aggregation-gateway/templates/_helpers.tpl +++ b/charts/prom-aggregation-gateway/templates/_helpers.tpl @@ -2,6 +2,10 @@ {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} +{{- define "prom-aggregation-gateway.namespace" -}} +{{- default .Release.Namespace .Values.namespaceOverride }} +{{- end }} + {{- define "prom-aggregation-gateway.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end -}} diff --git a/charts/prom-aggregation-gateway/templates/controller.yaml b/charts/prom-aggregation-gateway/templates/controller.yaml index 856afbd..f5f6c17 100644 --- a/charts/prom-aggregation-gateway/templates/controller.yaml +++ b/charts/prom-aggregation-gateway/templates/controller.yaml @@ -2,6 +2,7 @@ apiVersion: apps/v1 kind: {{ .Values.controller.type }} metadata: name: {{ .Release.Name }} + namespace: {{ template "prometheus-pushgateway.namespace" . }} labels: {{- include "prom-aggregation-gateway.labels" . | nindent 4 }} {{- if .Values.controller.labels }} diff --git a/charts/prom-aggregation-gateway/templates/podmonitor.yaml b/charts/prom-aggregation-gateway/templates/podmonitor.yaml index c175140..bd9f43f 100644 --- a/charts/prom-aggregation-gateway/templates/podmonitor.yaml +++ b/charts/prom-aggregation-gateway/templates/podmonitor.yaml @@ -3,6 +3,7 @@ apiVersion: monitoring.coreos.com/v1 kind: PodMonitor metadata: name: {{ .Release.Name }}-metrics + namespace: {{ template "prometheus-pushgateway.namespace" . }} {{- with .Values.podMonitor.additionalLabels }} labels: {{- toYaml . | nindent 4 }} diff --git a/charts/prom-aggregation-gateway/templates/service.yaml b/charts/prom-aggregation-gateway/templates/service.yaml index 670c402..6c11e2d 100644 --- a/charts/prom-aggregation-gateway/templates/service.yaml +++ b/charts/prom-aggregation-gateway/templates/service.yaml @@ -3,6 +3,7 @@ apiVersion: v1 kind: Service metadata: name: {{ .Release.Name }} + namespace: {{ template "prometheus-pushgateway.namespace" . }} labels: {{- include "prom-aggregation-gateway.selectorLabels" . | nindent 4 }} {{- with .Values.service.annotations }} diff --git a/charts/prom-aggregation-gateway/templates/servicemonitor.yaml b/charts/prom-aggregation-gateway/templates/servicemonitor.yaml index fb17879..c9c66a9 100644 --- a/charts/prom-aggregation-gateway/templates/servicemonitor.yaml +++ b/charts/prom-aggregation-gateway/templates/servicemonitor.yaml @@ -3,6 +3,7 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: {{ .Release.Name }} + namespace: {{ template "prometheus-pushgateway.namespace" . }} {{- with .Values.serviceMonitor.additionalLabels }} labels: {{- toYaml . | nindent 4 }} diff --git a/charts/prom-aggregation-gateway/values.schema.json b/charts/prom-aggregation-gateway/values.schema.json index cac5936..e2f0688 100644 --- a/charts/prom-aggregation-gateway/values.schema.json +++ b/charts/prom-aggregation-gateway/values.schema.json @@ -64,6 +64,9 @@ "nameOverride": { "type": "string" }, + "namespaceOverride": { + "type": "string" + }, "service": { "type": "object", "additionalProperties": false,