Azure / Azure-Functions

1.11k stars 194 forks source link

java azure function in AKS with KEDA with non-root user #2529

Open roshankrb opened 1 month ago

roshankrb commented 1 month ago

When we try to run our java azure function as non root member with having access to only read only file system, pod fails to start. how ever if it is root user, pod is starting fine. Can u help understand what changes we need to do in order to be able to run the pod as non root user

provided files contains our Dockerfile, deployment.yaml and logs

deployment-dev.log dev_kube_logs_22Jul_SecurityConetext_Error.txt Dockerfile.log Dockerfile.log

bhagyshricompany commented 1 month ago

Thanks for reporting will check and update .meanwhile you can check these steps1- Create a Non-Root User in Dockerfile:2-Set File Permissions in Dockerfile:3-Configure Security Context in Kubernetes:4-Use ConfigMaps and Secrets for Configuration Files:5-Verify Pod Logs and Events: and share with use if possible

jviau commented 1 month ago

https://github.com/Azure/azure-functions-host/issues/10164 possibly related.

Running as non-root does not work by default and requires a custom docker image.

roshankrb commented 1 month ago

Hi @jviau , can u provide java example /guide on how to come up with custom docker image.