Getting Argument list too long while opening google chrome iniside pods

I am trying to run browser tests inside the pod in headless mode in Google chrome.
I use a node:slim image and then installed Google-chrome in it .can see that installation is successful
When I try to run tests using chrome , during chrome launch inside pod I am getting argument list too long , browser launch fails and pods go into error state (pods have 7000MB memory and 3CPU). Chrome browser logs attached below and launch args are default ones.

Tried various options and chrome is still not launching properly. tried running a chrome headless to a dummy site as well outside of browser tests but during launch time this error is coming

Cluster information:

Kubernetes version:
Cloud being used: (put bare-metal if not on a public cloud) AWS
Installation method:
Host OS: Linux and
CNI and version:
CRI and version:

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.

The OS kernel limits the size of the buffer used to store arguments in exec. Depending on the kernel config it could be as low as 32KB or could be several MB.

It sounds like your args are too large for your OS config. Googling the error message will show you lots of people who hit the same problem in Linux.

ARG_MAX shows 2097152. Is it too high.
My local Mac has only 1048576
Can we alter it

That’s 2MB. How are you generating 2MB of args? Post YAML or JSON.

I am just launching chrome
Not sure what sort of arguments by default it’s using
2MB is the max value for the kernel

Tried from test automation library as well as launching like chrome docs suggested also

chrome \
--headless \                   # Runs Chrome in headless mode.
--disable-gpu \                # Temporarily needed if running on Windows.
--remote-debugging-port=9222 \
https://www.chromestatus.com   # URL to open. Defaults to about:blank.

Can you paste a full pod YAML?