Skip to content

Commit

Permalink
feat: cookie test
Browse files Browse the repository at this point in the history
  • Loading branch information
akurilov committed Mar 21, 2024
1 parent 80350e5 commit 8acbfdc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
8 changes: 6 additions & 2 deletions helm/webapp/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ metadata:
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/session-cookie-expires: "86400"
{{- range .Values.ingress.hosts }}
{{- if .cookie.enabled }}
nginx.ingress.kubernetes.io/session-cookie-domain: "{{ .host }}"
nginx.ingress.kubernetes.io/session-cookie-expires: "{{ .cookie.expires.seconds }}"
nginx.ingress.kubernetes.io/session-cookie-max-age: "{{ .cookie.expires.seconds }}"
nginx.ingress.kubernetes.io/session-cookie-name: "{{ .cookie.name }}"
nginx.ingress.kubernetes.io/session-cookie-samesite: "{{ .cookie.samesite }}"
{{- end }}
{{- end }}
nginx.ingress.kubernetes.io/session-cookie-samesite: "Strict"
spec:
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
ingressClassName: {{ .Values.ingress.className }}
Expand Down
6 changes: 6 additions & 0 deletions helm/webapp/values-demo-0.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
ingress:
hosts:
- host: awakari.com
cookie:
enabled: true
name: "awakari"
expires:
seconds: 86400
samesite: "Strict"
paths:
- path: /
pathType: Prefix
Expand Down
2 changes: 2 additions & 0 deletions helm/webapp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ ingress:
enabled: true
hosts:
- host: webapp.local
cookie:
enabled: false
paths:
- path: /
pathType: Prefix
Expand Down

0 comments on commit 8acbfdc

Please sign in to comment.