Just a short one, which I used a while to figure out myself.
One straight forward way to run the Nextcloud occ
command,
when you are running in a kubernetes cluster.
Is to exec into the container as root, and then run
su www-data -s /bin/bash -c "php occ <command>"
If you have a comment, please e-mail [email protected], I will add it to a comment section below :)
Please indicate how you want me to identify you (or not) in the e-mail.