I'm killing a process inside a pod with command:
kubectl exec ${pod} -- bash -c "kill -9 \`ps -ef | grep ${something} | grep -v grep | awk '{print \$2}'\` >/dev/null 2>&1" >/dev/null 2>&1
and I get "command terminated with exit code 137"
message that indicates that process ${something}
was really killed. How can I redirect the exit code?
Running the Process:
kubectl --namespace=magellan exec $pod 2>/dev/null -- bash -c "some remote command"
And after it killing the process does not redirect the error to screen