chaosblade-io / chaosblade-box

chaos-platform
216 stars 98 forks source link

Pod experiment failed due to "mount: permission denied (are you root?)" #60

Open kelvinguo0210 opened 3 years ago

kelvinguo0210 commented 3 years ago

Issue: As user exec pod experiments from chaosblade-box, the experiments failed due to mount errors. Operator Log time="2021-07-26T02:59:01Z" level=info msg="get err message" command="[/opt/chaosblade/blade create mem load --mem-percent=40]" container=aldi-ms--deployment--a err="{\"code\":604,\"success\":false,\"error\":\"{\\"code\\":604,\\"success\\":false,\\"error\\":\\"mount: permission denied (are you root?)\\n exit status 1\\"} exit status 1\"}" out= podName=aldi-ms--deployment--a-c5fcc46bc-fvnch podNamespace=aldi time="2021-07-26T02:59:01Z" level=error msg="exec: k8s exec failed, err: {\"code\":604,\"success\":false,\"error\":\"{\\"code\\":604,\\"success\\":false,\\"error\\":\\"mount: permission denied (are you root?)\\n exit status 1\\"} exit status 1\"}\n" location="github.com/chaosblade-io/chaosblade-operator/exec/model.(*ExecCommandInPodExecutor).execCommands.func1" uid= RCA The target container should have privilege. Work Around Manually add privilege for Application deployment, example containers:

Long term solution TBD ...

kelvinguo0210 commented 3 years ago

@tiny-x and other contributors, for this issue, seems like it required end user to modify their DevOps pipeline to make their deployment to have admin privilege before the experiment... so do you guys have better idea to make things more smoothly?