-
Notifications
You must be signed in to change notification settings - Fork 860
Add support for traefik as an ingress #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -5,7 +5,14 @@ metadata: | |||||||||||||
| namespace: {{ .Release.Namespace }} | ||||||||||||||
| labels: | ||||||||||||||
| {{- include "n8n.labels" . | nindent 4 }} | ||||||||||||||
| {{- $isTraefik := and .Values.ingress.enabled .Values.ingress.sticky.enabled (or (eq .Values.ingress.className "traefik") (hasKey (default dict .Values.ingress.annotations) "traefik.ingress.kubernetes.io/router.entrypoints")) }} | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Traefik backend detection misses the common annotation-based class ( Prompt for AI agents
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sticky-service annotations did appear during testing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think this actually a valid finding. The previous check only looked for the existence of kubernetes.io/ingress.class, so a user with kubernetes.io/ingress.class: traefik would have incorrectly gotten Nginx annotations rendered on their Ingress. |
||||||||||||||
| {{- $merged := merge (deepCopy (.Values.service.main.annotations | default dict)) (.Values.service.annotations | default dict) }} | ||||||||||||||
| {{- if $isTraefik }} | ||||||||||||||
| {{- $_ := set $merged "traefik.ingress.kubernetes.io/service.sticky.cookie" "true" }} | ||||||||||||||
| {{- $_ := set $merged "traefik.ingress.kubernetes.io/service.sticky.cookie.name" .Values.ingress.sticky.cookieName }} | ||||||||||||||
| {{- $_ := set $merged "traefik.ingress.kubernetes.io/service.sticky.cookie.secure" (.Values.ingress.sticky.cookieSecure | toString) }} | ||||||||||||||
| {{- $_ := set $merged "traefik.ingress.kubernetes.io/service.sticky.cookie.httponly" "true" }} | ||||||||||||||
| {{- end }} | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||
| {{- with $merged }} | ||||||||||||||
| annotations: | ||||||||||||||
| {{- toYaml . | nindent 4 }} | ||||||||||||||
|
|
||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -156,9 +156,12 @@ | |||||
| # ----- Ingress ----- | ||||||
| ingress: | ||||||
| enabled: false | ||||||
| className: "" # supported types are "traefik" & "nginx", "traefik" is suggested as nginx-ingress is deprecated | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: Using Prompt for AI agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the default configuration as it existed originally There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, agreed. Users with a custom class name like "nginx-internal", etc. would have had the same behavior before this PR change. |
||||||
| sticky: | ||||||
| enabled: false | ||||||
| cookieName: n8n_affinity | ||||||
| cookieSecure: true # set to false when using plain HTTP (e.g. local minikube) | ||||||
| # cookieExpires and cookieMaxAge are nginx-only, these are ignored by traefik | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: The comment incorrectly claims Prompt for AI agents
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is correct according to testing, these settings were ignored. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I think what the bot wants to say is that the statement is not fully correct. cookieExpires is not support by Traefik, but |
||||||
| cookieExpires: "172800" # 2 days in seconds | ||||||
| cookieMaxAge: "172800" # 2 days in seconds | ||||||
| hosts: | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.