- You should understand the data structure of this object. You can use
kubectl get events --output json
to check the data structure.
$ kubectl get events --output json
{
"apiVersion": "v1",
"items": [
{
"apiVersion": "v1",
"count": 259,
"eventTime": null,
"firstTimestamp": "2020-04-15T12:00:46Z",
"involvedObject": { <------ **this**
"apiVersion": "v1",
"fieldPath": "spec.containers{liveness}",
"kind": "Pod",
"name": "liveness-exec", <------ **this**
"namespace": "default",
"resourceVersion": "725991",
"uid": "3f497636-e601-48bc-aec8-72b3edec3d95"
},
...
- And then do something like
kubectl get events --field-selector involvedObject.name=[...]
.
This answer refers to @mszalbach's.