Skip to content

Commit 9b0938f

Browse files
zhaohehuhupan3793
andcommitted
[KYUUBI #5631] [K8S][HELM] Set session affinity if needed in helm chart
### _Why are the changes needed?_ This can ensure that incoming requests from same client are forward to the same Kyuubi service instance in K8S. So this may be a workaround for users to get their session states during a period of time. ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [ ] [Run test](https://kyuubi.readthedocs.io/en/master/contributing/code/testing.html#running-tests) locally before make a pull request ### _Was this patch authored or co-authored using generative AI tooling?_ No. Closes #5631 from zhaohehuhu/dev-1106. Closes #5631 ba1a733 [Cheng Pan] comments 6f9d629 [hezhao2] reformat db9e842 [hezhao2] take toYaml approach d94354d [hezhao2] refactor c5f055a [hezhao2] sync 8695532 [hezhao2] set session affinity if needed Lead-authored-by: hezhao2 <hezhao2@cisco.com> Co-authored-by: Cheng Pan <chengpan@apache.org> Signed-off-by: Cheng Pan <chengpan@apache.org>
1 parent 111786f commit 9b0938f

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

charts/kyuubi/templates/kyuubi-service.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ spec:
3737
{{- end }}
3838
selector:
3939
{{- include "kyuubi.selectorLabels" $ | nindent 4 }}
40+
{{- if ($frontend.service.sessionAffinity) }}
41+
sessionAffinity: {{ $frontend.service.sessionAffinity }}
42+
{{- end }}
43+
{{- with $frontend.service.sessionAffinityConfig }}
44+
sessionAffinityConfig: {{- toYaml . | nindent 4 }}
45+
{{- end }}
4046
---
4147
{{- end }}
4248
{{- end }}

charts/kyuubi/values.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ server:
8585
port: "{{ .Values.server.thriftBinary.port }}"
8686
nodePort: ~
8787
annotations: {}
88+
# candidates are ClientIP or None
89+
# https://kubernetes.io/docs/reference/kubernetes-api/service-resources/service-v1/
90+
sessionAffinity: ~
91+
sessionAffinityConfig: {}
92+
# sessionAffinityConfig:
93+
# clientIP:
94+
# timeoutSeconds: 10800
8895

8996
# Thrift HTTP protocol (HiveServer2 compatible)
9097
thriftHttp:
@@ -95,6 +102,13 @@ server:
95102
port: "{{ .Values.server.thriftHttp.port }}"
96103
nodePort: ~
97104
annotations: {}
105+
# candidates are ClientIP or None
106+
# https://kubernetes.io/docs/reference/kubernetes-api/service-resources/service-v1/
107+
sessionAffinity: ~
108+
sessionAffinityConfig: {}
109+
# sessionAffinityConfig:
110+
# clientIP:
111+
# timeoutSeconds: 10800
98112

99113
# REST API protocol (experimental)
100114
rest:
@@ -105,6 +119,13 @@ server:
105119
port: "{{ .Values.server.rest.port }}"
106120
nodePort: ~
107121
annotations: {}
122+
# candidates are ClientIP or None
123+
# https://kubernetes.io/docs/reference/kubernetes-api/service-resources/service-v1/
124+
sessionAffinity: ~
125+
sessionAffinityConfig: {}
126+
# sessionAffinityConfig:
127+
# clientIP:
128+
# timeoutSeconds: 10800
108129

109130
# MySQL compatible text protocol (experimental)
110131
mysql:
@@ -115,6 +136,13 @@ server:
115136
port: "{{ .Values.server.mysql.port }}"
116137
nodePort: ~
117138
annotations: {}
139+
# candidates are ClientIP or None
140+
# https://kubernetes.io/docs/reference/kubernetes-api/service-resources/service-v1/
141+
sessionAffinity: ~
142+
sessionAffinityConfig: {}
143+
# sessionAffinityConfig:
144+
# clientIP:
145+
# timeoutSeconds: 10800
118146

119147
monitoring:
120148
# Exposes metrics in Prometheus format

0 commit comments

Comments
 (0)