Skip to content

Commit

Permalink
PRO-2745: allow sticky sessions to be enabled (#41)
Browse files Browse the repository at this point in the history
* PRO-2745: allow sticky sessions to be enabled

* chart bump

* fix spaces
  • Loading branch information
domdepasquale authored Jul 28, 2023
1 parent d8828cb commit 277f83b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
5 changes: 4 additions & 1 deletion charts/application-core/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.2.0
version: 1.3.0

maintainers:
- name: Dominic DePasquale
16 changes: 16 additions & 0 deletions charts/application-core/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@ metadata:
{{- include "application-core.annotations" $ | nindent 4 }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if not .Values.sessionAffinity.enabled }}
nginx.ingress.kubernetes.io/service-upstream: "true"
{{- end}}
{{- if .Values.sessionAffinity.enabled }}
nginx.ingress.kubernetes.io/affinity: "cookie"
{{- if .Values.sessionAffinity.cookieName }}
nginx.ingress.kubernetes.io/session-cookie-name: {{ .Values.sessionAffinity.cookieName | quote }}
{{- end }}
{{- if .Values.sessionAffinity.mode }}
nginx.ingress.kubernetes.io/affinity-mode: {{ .Values.sessionAffinity.mode | quote }}
{{- end }}
nginx.ingress.kubernetes.io/configuration-snippet: |
{{- if .Values.sessionAffinity.enabled }}
proxy_set_header l5d-dst-override $service_name.$namespace.svc.cluster.local:$service_port;
{{- end }}
{{- end }}
spec:
ingressClassName: {{ .Values.ingress.className }}
{{- if .Values.ingress.tls }}
Expand Down
6 changes: 5 additions & 1 deletion charts/application-core/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,15 @@ service:
type: ClusterIP
port: 8000

sessionAffinity:
enabled: false
# cookieName: "JSESSIONID"
mode: persistent # persistent|balanced

ingress:
enabled: false
className: "nginx"
annotations:
nginx.ingress.kubernetes.io/service-upstream: "true"
external-dns.alpha.kubernetes.io/ingress-hostname-source: annotation-only
# kubernetes.io/tls-acme: "true"
hosts:
Expand Down

0 comments on commit 277f83b

Please sign in to comment.