You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since NC 33 the UI recommends setting NC_serverid to a unique value per server of a nextcloud cluster. Since the ids should be stable and unique it suggests using a StatefulSet and using its ordinal as the serverid value.
I also think that it would be best to use a StatefulSet instead. The ordinal numbers used in StatefulSets are exactly what would be needed for the NC_serverid variable.
I think there are two options here:
Switch the deployment to a StatefulSet by default. I don't know if there are any downsides to this for other users.
Add a variable to the values.md, called kind (or something similar) which is "Deployment" by default, or "StatefulSet". This would ensure that current setups don't break. If it is set to "StatefulSet", we could add the NC_serverid variable.
{{- if eq (include "nextcloud.workloadKind" .) "StatefulSet" }}
- name: NC_serveridvalueFrom:
fieldRef:
fieldPath: metadata.labels['apps.kubernetes.io/pod-index']{{- end }}
If we (and potentially the maintainers) can agree on an implementation, I would create the merge request and the tests for it, because I also need and want this change. 😄
Activity
csantv commentedon Apr 18, 2026
csantv commentedon Apr 19, 2026
Ignore my previous comment. This should be a proper config using init containers.
pschichtel commentedon Apr 19, 2026
I wonder if it'd a problem, that this will produce new ids on every restart
csantv commentedon Apr 19, 2026
That makes sense I think as pods are new nextcloud servers. You could also checksum the node name instead and have more stable values.
lukashartl commentedon Aug 28, 2026
I also think that it would be best to use a
StatefulSetinstead. The ordinal numbers used in StatefulSets are exactly what would be needed for the NC_serverid variable.I think there are two options here:
values.md, calledkind(or something similar) which is"Deployment"by default, or"StatefulSet". This would ensure that current setups don't break. If it is set to"StatefulSet", we could add the NC_serverid variable.If we (and potentially the maintainers) can agree on an implementation, I would create the merge request and the tests for it, because I also need and want this change. 😄
pschichtel commentedon Aug 30, 2026
probably saver to have it opt-in.
csantv commentedon Oct 23, 2026
Better config without init containers
I still think each pod is an independent php/nextcloud server so its fine to be dynamic if we treat them as cattle.