Skip to content

Commit

Permalink
[kube-prometheus-stack] introduced servicePort field to select ingres…
Browse files Browse the repository at this point in the history
…s target for alertmanager/prometheus (prometheus-community#2163)

* introduce: servicePort field to select ingress target for alertmanager/prometheus

Signed-off-by: Martin Weber <[email protected]>

* fix: formatting issue

Signed-off-by: Martin Weber <[email protected]>

* bump: version to 36.0.4

Signed-off-by: Martin Weber <[email protected]>

* Update charts/kube-prometheus-stack/Chart.yaml

Co-authored-by: André Bauer <[email protected]>

Signed-off-by: Martin Weber <[email protected]>

* Update charts/kube-prometheus-stack/Chart.yaml

Co-authored-by: André Bauer <[email protected]>

Signed-off-by: Martin Weber <[email protected]>
  • Loading branch information
spr-mweber3 authored Jul 11, 2022
1 parent b3eba77 commit 9cc23ef
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/kube-prometheus-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ name: kube-prometheus-stack
sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
version: 36.6.1
version: 36.6.2
appVersion: 0.57.0
kubeVersion: ">=1.16.0-0"
home: https://github.com/prometheus-operator/kube-prometheus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- if and .Values.alertmanager.enabled .Values.alertmanager.ingress.enabled }}
{{- $pathType := .Values.alertmanager.ingress.pathType | default "ImplementationSpecific" }}
{{- $serviceName := printf "%s-%s" (include "kube-prometheus-stack.fullname" .) "alertmanager" }}
{{- $servicePort := .Values.alertmanager.service.port -}}
{{- $servicePort := .Values.alertmanager.ingress.servicePort | default .Values.alertmanager.service.port -}}
{{- $routePrefix := list .Values.alertmanager.alertmanagerSpec.routePrefix }}
{{- $paths := .Values.alertmanager.ingress.paths | default $routePrefix -}}
{{- $apiIsStable := eq (include "kube-prometheus-stack.ingress.isStable" .) "true" -}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{- if and .Values.prometheus.enabled .Values.prometheus.ingress.enabled -}}
{{- $pathType := .Values.prometheus.ingress.pathType | default "ImplementationSpecific" -}}
{{- $serviceName := printf "%s-%s" (include "kube-prometheus-stack.fullname" .) "prometheus" -}}
{{- $servicePort := .Values.prometheus.service.port -}}
{{- $servicePort := .Values.prometheus.ingress.servicePort | default .Values.prometheus.service.port -}}
{{- $routePrefix := list .Values.prometheus.prometheusSpec.routePrefix -}}
{{- $paths := .Values.prometheus.ingress.paths | default $routePrefix -}}
{{- $apiIsStable := eq (include "kube-prometheus-stack.ingress.isStable" .) "true" -}}
Expand Down
38 changes: 38 additions & 0 deletions charts/kube-prometheus-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,9 @@ alertmanager:

labels: {}

## Redirect ingress to an additional defined port on the service
# servicePort: 8081

## Hosts must be provided if Ingress is enabled.
##
hosts: []
Expand Down Expand Up @@ -349,6 +352,10 @@ alertmanager:

## Additional ports to open for Alertmanager service
additionalPorts: []
# additionalPorts:
# - name: authenticated
# port: 8081
# targetPort: 8081

externalIPs: []
loadBalancerIP: ""
Expand Down Expand Up @@ -635,6 +642,18 @@ alertmanager:
## Containers allows injecting additional containers. This is meant to allow adding an authentication proxy to an Alertmanager pod.
##
containers: []
# containers:
# - name: oauth-proxy
# image: quay.io/oauth2-proxy/oauth2-proxy:v7.1.2
# args:
# - --upstream=http://127.0.0.1:9093
# - --http-address=0.0.0.0:8081
# - ...
# ports:
# - containerPort: 8081
# name: oauth-proxy
# protocol: TCP
# resources: {}

# Additional volumes on the output StatefulSet definition.
volumes: []
Expand Down Expand Up @@ -1939,6 +1958,10 @@ prometheus:

## Additional port to define in the Service
additionalPorts: []
# additionalPorts:
# - name: authenticated
# port: 8081
# targetPort: 8081

## Consider that all endpoints are considered "ready" even if the Pods themselves are not
## Ref: https://kubernetes.io/docs/reference/kubernetes-api/service-resources/service-v1/#ServiceSpec
Expand Down Expand Up @@ -2047,6 +2070,9 @@ prometheus:
annotations: {}
labels: {}

## Redirect ingress to an additional defined port on the service
# servicePort: 8081

## Hostnames.
## Must be provided if Ingress is enabled.
##
Expand Down Expand Up @@ -2653,6 +2679,18 @@ prometheus:
## Containers allows injecting additional containers. This is meant to allow adding an authentication proxy to a Prometheus pod.
## if using proxy extraContainer update targetPort with proxy container port
containers: []
# containers:
# - name: oauth-proxy
# image: quay.io/oauth2-proxy/oauth2-proxy:v7.1.2
# args:
# - --upstream=http://127.0.0.1:9093
# - --http-address=0.0.0.0:8081
# - ...
# ports:
# - containerPort: 8081
# name: oauth-proxy
# protocol: TCP
# resources: {}

## InitContainers allows injecting additional initContainers. This is meant to allow doing some changes
## (permissions, dir tree) on mounted volumes before starting prometheus
Expand Down

0 comments on commit 9cc23ef

Please sign in to comment.