Skip to content

Commit

Permalink
[kube-prometheus-stack] Allow configuration of sessionAffinityConfig (#…
Browse files Browse the repository at this point in the history
…4076)

* [kube-prometheus-stack] Allow configuration of sessionAffinityConfig

Signed-off-by: karloramone <[email protected]>

* [kube-prometheus-stack] Bump chart version to 55.2.0

Signed-off-by: karloramone <[email protected]>

* [kube-prometheus-stack] Bump chart version to 55.3.0

Signed-off-by: karloramone <[email protected]>

---------

Signed-off-by: karloramone <[email protected]>
Signed-off-by: Karlo <[email protected]>
Co-authored-by: Quentin Bisson <[email protected]>
  • Loading branch information
karloramone and QuentinBisson authored Dec 11, 2023
1 parent 8ff16a7 commit e698c26
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 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 @@ -21,7 +21,7 @@ name: kube-prometheus-stack
sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
version: 55.2.0
version: 55.3.0
appVersion: v0.70.0
kubeVersion: ">=1.19.0-0"
home: https://github.com/prometheus-operator/kube-prometheus
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ spec:
alertmanager: {{ template "kube-prometheus-stack.alertmanager.crname" . }}
{{- if .Values.alertmanager.service.sessionAffinity }}
sessionAffinity: {{ .Values.alertmanager.service.sessionAffinity }}
{{- end }}
{{- if eq .Values.alertmanager.service.sessionAffinity "ClientIP" }}
sessionAffinityConfig:
clientIP:
timeoutSeconds: {{ .Values.alertmanager.service.sessionAffinityConfig.clientIP.timeoutSeconds }}
{{- end }}
type: "{{ .Values.alertmanager.service.type }}"
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ spec:
operator.prometheus.io/name: {{ template "kube-prometheus-stack.prometheus.crname" . }}
{{- if .Values.prometheus.service.sessionAffinity }}
sessionAffinity: {{ .Values.prometheus.service.sessionAffinity }}
{{- end }}
{{- if eq .Values.prometheus.service.sessionAffinity "ClientIP" }}
sessionAffinityConfig:
clientIP:
timeoutSeconds: {{ .Values.prometheus.service.sessionAffinityConfig.clientIP.timeoutSeconds }}
{{- end }}
type: "{{ .Values.prometheus.service.type }}"
{{- end }}
23 changes: 20 additions & 3 deletions charts/kube-prometheus-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -498,9 +498,16 @@ alertmanager:
externalTrafficPolicy: Cluster

## If you want to make sure that connections from a particular client are passed to the same Pod each time
## Accepts 'ClientIP' or ''
## Accepts 'ClientIP' or 'None'
##
sessionAffinity: ""
sessionAffinity: None

## If you want to modify the ClientIP sessionAffinity timeout
## The value must be >0 && <=86400(for 1 day) if ServiceAffinity == "ClientIP"
##
sessionAffinityConfig:
clientIP:
timeoutSeconds: 10800

## Service type
##
Expand Down Expand Up @@ -2885,7 +2892,17 @@ prometheus:
## Ref: https://kubernetes.io/docs/reference/kubernetes-api/service-resources/service-v1/#ServiceSpec
publishNotReadyAddresses: false

sessionAffinity: ""
## If you want to make sure that connections from a particular client are passed to the same Pod each time
## Accepts 'ClientIP' or 'None'
##
sessionAffinity: None

## If you want to modify the ClientIP sessionAffinity timeout
## The value must be >0 && <=86400(for 1 day) if ServiceAffinity == "ClientIP"
##
sessionAffinityConfig:
clientIP:
timeoutSeconds: 10800

## Configuration for creating a separate Service for each statefulset Prometheus replica
##
Expand Down

0 comments on commit e698c26

Please sign in to comment.