Skip to content

Commit

Permalink
[prometheus] Adding additionalPorts and servicePort (#3779)
Browse files Browse the repository at this point in the history
* Adding additionalPorts and servicePort

Signed-off-by: Morten Birkelund <[email protected]>

* Change version bump from patch to minor

Co-authored-by: zeritti <[email protected]>
Signed-off-by: Morten Birkelund <[email protected]>

---------

Signed-off-by: Morten Birkelund <[email protected]>
Signed-off-by: MH <[email protected]>
Signed-off-by: Morten Birkelund <[email protected]>
Co-authored-by: MH <[email protected]>
Co-authored-by: zeritti <[email protected]>
  • Loading branch information
3 people authored Sep 13, 2023
1 parent 0f018d1 commit 183caee
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/prometheus/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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/
Expand Down
2 changes: 1 addition & 1 deletion charts/prometheus/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down
3 changes: 3 additions & 0 deletions charts/prometheus/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
23 changes: 23 additions & 0 deletions charts/prometheus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
##
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 183caee

Please sign in to comment.