apisix-helm-chart icon indicating copy to clipboard operation
apisix-helm-chart copied to clipboard

Running Apisix with securityContext does not work

Open luarx opened this issue 1 year ago • 1 comments

I am running Apisix Helm Chart version 2.10.0 I want to run Apisix with the suggested security context does not work

securityContext:
  capabilities:
    drop:
    - ALL
  readOnlyRootFilesystem: true
  runAsNonRoot: true
  runAsUser: 1000

It throws this error:

Defaulted container "apisix" out of: apisix, wait-etcd (init)
/usr/local/openresty//luajit/bin/luajit ./apisix/cli/apisix.lua init
failed to update nginx.conf: failed to open file: /usr/local/apisix/conf/nginx.conf, error info:/usr/local/apisix/conf/nginx.conf: Read-only file system

And if readOnlyRootFilesystem is set to false, it says:

Defaulted container "apisix" out of: apisix, wait-etcd (init)
/usr/local/openresty//luajit/bin/luajit ./apisix/cli/apisix.lua init
failed to update nginx.conf: failed to open file: /usr/local/apisix/conf/nginx.conf, error info:/usr/local/apisix/conf/nginx.conf: Permission denied

How should I run Apisix with a protective securityContext?

luarx avatar Feb 11 '25 14:02 luarx

Image

@luarx Is it same even if you designate UID as 636?

kworkbee avatar Jul 29 '25 09:07 kworkbee