Skip to content

feat(nextcloud): Allow specifying service session affinity in helm chart - #765

Merged
wrenix merged 2 commits into
nextcloud:mainfrom
qdii:main
Sep 4, 2025
Merged

wrenix merged 2 commits into
nextcloud:mainfrom
qdii:main

Conversation

@qdii

@qdii qdii commented Aug 28, 2025 •

Copy link
Copy Markdown
Contributor

… chart

Description of the change

Services in kubernetes have the notion of session affinity which allow a given client to be sent to the same backend.

Benefits

When multiple instances of Nextcloud are deployed (for high availability), certain applications may break, for instance because a CSRF token is generated in one pod, and evaluated in another pod.

This feature mitigates this sort of application bugs.

Possible drawbacks

When enabled, the load between the pods may become uneven. However this is a choice of the administrator.

Checklist

@wrenix wrenix left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add also an toYaml for sessionAffinityConfig

Are your sure that this has your wish affect?
Maybe you want to take a look into your IngressController:
https://github.com/nextcloud/helm/tree/main/charts/nextcloud#ingress-sticky-sessions

Comment thread charts/nextcloud/values.yaml
Comment thread charts/nextcloud/values.yaml Outdated
@qdii

qdii commented Aug 30, 2025 •

Copy link
Copy Markdown
Contributor Author

As far as I understand, there are two different load-balancing system here:

  • The Ingress configures the frontend pod so that it balances the load between the different backends behind it. In my setup, it adds configuration lines to the nginx instance which fronts nextcloud. There is just one upstream backend: the nextcloud service, so it doesn't do much.

  • The Service configures the nextcloud service so that it balances the load to the nextcloud pods behind it. In practice I guess it configures kube-proxy, which likely set up iptables/nftables in turn.

So to answer your question, I'm fairly confident that this has the right effect, because I checked that the same user was correctly going to the same nginx instance, same service, but somehow ended up on different pods.

@qdii qdii closed this Aug 30, 2025
@wrenix

wrenix commented Sep 2, 2025

Copy link
Copy Markdown
Collaborator

Why you close your PR, it was already really good and close to merge?

Thanks for your description, the kube-proxy setup explant good your needs. For the most ingress-controller the most use direct the Endpoints behind the service (and for the service the Client is the ingress-controller pod).

@qdii

qdii commented Sep 2, 2025

Copy link
Copy Markdown
Contributor Author

Ah sorry, I'm not used to github, and I thought I was closing a comment, not the PR. Let me reopen it.

@qdii qdii reopened this Sep 2, 2025
@wrenix

wrenix commented Sep 3, 2025

Copy link
Copy Markdown
Collaborator

LGFM, do you like to signoff your commits?

@qdii
qdii force-pushed the main branch 2 times, most recently from f07b786 to 0f34a62 Compare September 3, 2025 18:58
@qdii

qdii commented Sep 3, 2025

Copy link
Copy Markdown
Contributor Author

Should be good :)

@wrenix

wrenix commented Sep 3, 2025

Copy link
Copy Markdown
Collaborator

Sadly not, could you take a Look in the DCO check/action/job?
https://github.com/nextcloud/helm/pull/765/checks?check_run_id=49531399229

qdii added 2 commits September 3, 2025 23:25
Signed-off-by: Victor Lavaud <victor.lavaud@pm.me>
…ion in helm chart

Signed-off-by: Victor Lavaud <victor.lavaud@pm.me>
@qdii

qdii commented Sep 3, 2025

Copy link
Copy Markdown
Contributor Author

Ah it looks like the commit should be signed and a line with "Signed Off by" should appear in the commit message. It only had the first part.

@wrenix wrenix changed the title feature(nextcloud): Allow specifying service session affinity in helm chart feat(nextcloud): Allow specifying service session affinity in helm chart Sep 4, 2025
@wrenix
wrenix enabled auto-merge September 4, 2025 07:32
@wrenix wrenix mentioned this pull request Sep 4, 2025
4 tasks done
@wrenix
wrenix merged commit 78c3c7f into nextcloud:main Sep 4, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants