Add external-oauth plugin in Kong image fails with permission issue

I was trying to have external-oauth plugin ( available in my Kong image. Hence, I tried to customize the image by adding “luarocks install external-oauth”. The image got built successfully, but when tried running the same in my K8s cluster, the proxy container failed with the following error.

kubectl logs -n kong ingress-kong-65588778f5-mcgnt proxy -f

Error: could not prepare Kong prefix at /usr/local/kong: Permission denied

Run with --v (verbose) or --vv (debug) for more details

I checked the file location and could see that, the permissions are well given.

I hit this yesterday too but haven’t dug into it yet.
Remove the securityContext stanza from your deployment and then it will work correctly.

SecurityContext was not present there in my script. Now, I added the following and the error is gone.

        runAsUser: 0
        runAsGroup: 0

© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ