Skip to content

fix(cronjob): change sidecar to cronstable for nonroot compatible (#733) - #871

Open
antoinetran wants to merge 1 commit into
nextcloud:mainfrom
antoinetran:feature/issue733-cronsidecar-nonroot
Open

fix(cronjob): change sidecar to cronstable for nonroot compatible (#733)#871
antoinetran wants to merge 1 commit into
nextcloud:mainfrom
antoinetran:feature/issue733-cronsidecar-nonroot

Conversation

@antoinetran

Copy link
Copy Markdown
Contributor

Description of the change

In shared Kubernetes environment which disable root containers, the cron as sidecar cannot work because cron implementation from alpine requires root. This change will replace to cronstable which is docker compliant and does not need root to work.

Benefits

Can work in restricted Kubernetes environment:

  • with non root policy
  • without PV as readwrite many, so impossible to use cronjob as Kubernetes cronjob

Possible drawbacks

Adds another image, but small footprint (~40MiB for alpine flavor)

Applicable issues

Additional information

Checklist

…xtcloud#733)

Signed-off-by: antoinetran <antoinetran@users.noreply.github.com>
# -- cronstable image registry # can be docker.io and ghcr.io. docker.io has a rate-limit.
registry: ghcr.io
# -- cronstable image name
repository: ptweezy/cronstable

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.

i am not sure, if we like to have more images from small projects here.

if you need a different compatible you could go to k8s cronjobs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I understand.

if you need a different compatible you could go to k8s cronjobs.

I tried it before, it did not work because the way nextcloud implements cronjob requires PVC with ReadWriteMany, which is not possible in any kubernetes cluster.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I also tried to ask busybox cron and vivix cron if they can provide a non-root compatible crond and this is not an easy task. So that's why I tried another image, which is less popular than busybox. At least this one is an official image, compared to supercronic, which also work as non-root but they do not provide official image.

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.

nextcloud-cron does not work in OpenShift

2 participants