Skip to content

Commit

Permalink
[kube-prometheus-stack] Implement Gateway API
Browse files Browse the repository at this point in the history
Signed-off-by: Jan-Otto Kröpke <[email protected]>
  • Loading branch information
jkroepke committed Aug 6, 2024
1 parent 9f9ccea commit 91d41d3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ alertmanager:
logLevel: {{ print "debug" | quote }}
prometheus:
gateway:
gatewayAPI:
httpRoute:
enabled: true
annotations:
Expand Down
14 changes: 7 additions & 7 deletions charts/kube-prometheus-stack/templates/prometheus/httproute.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{- if and .Values.prometheus.enabled .Values.prometheus.gateway.httpRoute.enabled -}}
{{- if and .Values.prometheus.enabled .Values.prometheus.gatewayAPI.httpRoute.enabled -}}
{{- $serviceName := printf "%s-%s" (include "kube-prometheus-stack.fullname" .) "prometheus" -}}
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
{{- with .Values.prometheus.gateway.httpRoute.annotations }}
{{- with .Values.prometheus.gatewayAPI.httpRoute.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
Expand All @@ -12,27 +12,27 @@ metadata:
labels:
app: {{ template "kube-prometheus-stack.name" . }}-prometheus
{{- include "kube-prometheus-stack.labels" . | nindent 4 }}
{{- with .Values.prometheus.gateway.httpRoute.labels }}
{{- with .Values.prometheus.gatewayAPI.httpRoute.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with .Values.prometheus.gateway.httpRoute.parentRefs }}
{{- with .Values.prometheus.gatewayAPI.httpRoute.parentRefs }}
parentRefs:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.prometheus.gateway.httpRoute.hostnames }}
{{- with .Values.prometheus.gatewayAPI.httpRoute.hostnames }}
hostnames:
{{- tpl (toYaml .) $ | nindent 4 }}
{{- end }}
rules:
- backendRefs:
- name: {{ $serviceName }}
port: {{ .Values.prometheus.service.port }}
{{- with .Values.prometheus.gateway.httpRoute.filters }}
{{- with .Values.prometheus.gatewayAPI.httpRoute.filters }}
filters:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.prometheus.gateway.httpRoute.matches }}
{{- with .Values.prometheus.gatewayAPI.httpRoute.matches }}
matches:
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/kube-prometheus-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3251,7 +3251,7 @@ prometheus:
# hosts:
# - prometheus.example.com

gateway:
gatewayAPI:
httpRoute:
enabled: false
annotations: {}
Expand Down

0 comments on commit 91d41d3

Please sign in to comment.