From efe935b06557d15eeaf57c5a3a76c6b5d3f50eea Mon Sep 17 00:00:00 2001 From: Morten Birkelund Date: Wed, 13 Sep 2023 12:35:00 +0200 Subject: [PATCH] [prometheus] Adding additionalPorts and servicePort (#3779) * Adding additionalPorts and servicePort Signed-off-by: Morten Birkelund * Change version bump from patch to minor Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> Signed-off-by: Morten Birkelund --------- Signed-off-by: Morten Birkelund Signed-off-by: MH Signed-off-by: Morten Birkelund Co-authored-by: MH Co-authored-by: zeritti <47476160+zeritti@users.noreply.github.com> --- charts/prometheus/Chart.yaml | 2 +- charts/prometheus/templates/ingress.yaml | 2 +- charts/prometheus/templates/service.yaml | 3 +++ charts/prometheus/values.yaml | 23 +++++++++++++++++++++++ 4 files changed, 28 insertions(+), 2 deletions(-) diff --git a/charts/prometheus/Chart.yaml b/charts/prometheus/Chart.yaml index d65d78c7f6ae..53571bbfab10 100644 --- a/charts/prometheus/Chart.yaml +++ b/charts/prometheus/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: prometheus appVersion: v2.47.0 -version: 24.4.0 +version: 24.5.0 kubeVersion: ">=1.19.0-0" description: Prometheus is a monitoring system and time series database. home: https://prometheus.io/ diff --git a/charts/prometheus/templates/ingress.yaml b/charts/prometheus/templates/ingress.yaml index fc2468d8bc5b..84341a9c2cf0 100644 --- a/charts/prometheus/templates/ingress.yaml +++ b/charts/prometheus/templates/ingress.yaml @@ -4,7 +4,7 @@ {{- $ingressSupportsPathType := eq (include "ingress.supportsPathType" .) "true" -}} {{- $releaseName := .Release.Name -}} {{- $serviceName := include "prometheus.server.fullname" . }} -{{- $servicePort := .Values.server.service.servicePort -}} +{{- $servicePort := .Values.server.ingress.servicePort | default .Values.server.service.servicePort -}} {{- $ingressPath := .Values.server.ingress.path -}} {{- $ingressPathType := .Values.server.ingress.pathType -}} {{- $extraPaths := .Values.server.ingress.extraPaths -}} diff --git a/charts/prometheus/templates/service.yaml b/charts/prometheus/templates/service.yaml index 1aa384eb0a97..069f3270d813 100644 --- a/charts/prometheus/templates/service.yaml +++ b/charts/prometheus/templates/service.yaml @@ -47,6 +47,9 @@ spec: nodePort: {{ .Values.server.service.gRPC.nodePort }} {{- end }} {{- end }} +{{- if .Values.server.service.additionalPorts }} +{{ toYaml .Values.server.service.additionalPorts | indent 4 }} +{{- end }} selector: {{- if and .Values.server.statefulSet.enabled .Values.server.service.statefulsetReplica.enabled }} statefulset.kubernetes.io/pod-name: {{ template "prometheus.server.fullname" . }}-{{ .Values.server.service.statefulsetReplica.replica }} diff --git a/charts/prometheus/values.yaml b/charts/prometheus/values.yaml index 45d3bcd32b9c..b47ec9921c36 100644 --- a/charts/prometheus/values.yaml +++ b/charts/prometheus/values.yaml @@ -117,6 +117,19 @@ server: # sidecarContainers: # webserver: # image: nginx + # OR for adding OAuth authentication to Prometheus + # sidecarContainers: + # oauth-proxy: + # image: quay.io/oauth2-proxy/oauth2-proxy:v7.1.2 + # args: + # - --upstream=http://127.0.0.1:9090 + # - --http-address=0.0.0.0:8081 + # - ... + # ports: + # - containerPort: 8081 + # name: oauth-proxy + # protocol: TCP + # resources: {} sidecarContainers: {} # sidecarTemplateValues - context to be used in template for sidecarContainers @@ -309,6 +322,9 @@ server: ## extraLabels: {} + ## Redirect ingress to an additional defined port on the service + # servicePort: 8081 + ## Prometheus server Ingress hostnames with optional path ## Must be provided if Ingress is enabled ## @@ -647,6 +663,13 @@ server: enabled: false replica: 0 + ## Additional port to define in the Service + additionalPorts: [] + # additionalPorts: + # - name: authenticated + # port: 8081 + # targetPort: 8081 + ## Prometheus server pod termination grace period ## terminationGracePeriodSeconds: 300