Repository navigation
fix(nextcloud): run the pods as the chart's own service account by default - #896
Open
martin-mat wants to merge 1 commit into
Open
martin-mat wants to merge 1 commit into
martin-mat wants to merge 1 commit into
Conversation
…fault The chart creates a service account only with rbac.enabled, which is off by default, so the Nextcloud pods run as the namespace's default service account. rbac.enabled binds the privileged PodSecurityPolicy, which Kubernetes removed in 1.25; the account itself has nothing to do with it. The service account is now created whenever rbac.serviceaccount.create is true (the default), whatever rbac.enabled says, and the Nextcloud Deployment and the cron CronJob always run as it. Its name defaults to the release's full name, so two releases in one namespace don't collide; a name set in rbac.serviceaccount.name is kept, and with create set to false that name is required and must name an existing account. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Martin Matyas <martin.matyas@tieto.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of the change
The chart's service account is now created whenever
rbac.serviceaccount.createis true (the default), independent ofrbac.enabled, and the Nextcloud Deployment and the cron CronJob always run as it:templates/serviceaccount.yaml: rendered onrbac.serviceaccount.createalone.templates/_helpers.tpl: anextcloud.serviceAccountNamehelper. The name defaults to the release's full name; a name set inrbac.serviceaccount.nameis kept; withcreate: falsethe name is required and must name an existing account.templates/deployment.yaml,templates/cronjob.yaml:serviceAccountNamealways set from the helper;templates/rbac.yaml: the RoleBinding subject from the same helper.values.yaml:rbac.serviceaccount.namedefaults to""(the release's full name), with comments; README rows corrected; chart 9.4.0 → 9.5.0.The PSP Role behind
rbac.enabledis unchanged.Benefits
The pods no longer run as the namespace's
defaultservice account, so:rbac.serviceaccount.annotationsworks withoutrbac.enabled, for cloud identity (IRSA, Workload Identity) to S3 primary storage;dedicated_service_accounttest are satisfied.Two releases in one namespace no longer collide on a fixed account name.
Possible drawbacks
rbac.enabled: trueand the old default namenextcloud-serviceaccountget an account named after the release instead. Roles bound tonextcloud-serviceaccountoutside the chart keep working ifrbac.serviceaccount.name: nextcloud-serviceaccountis set.create: falsewithout a name now fails at render time with a clear message, instead of silently running asdefault.Applicable issues
Additional information
Verified on a fork, on the current
main:helm linton the defaults and all ninetest-valuessets. Renders checked for the defaults, two releases in one namespace, an existing account,rbac.enabledwith the old name, the cron CronJob, andcreate: falsewithout a name.ct lintand all eight install cases pass (run 38956730034).dedicated_service_accountfails onmainand passes with this change; the essential tests are unchanged at 15 of 19.Checklist
Chart.yamlaccording to semver.🤖 Generated with Claude Code