Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ If you know the specific node name that you're interested in, you can exec into

```bash
NODE_NAME="my-node-name"
POD_NAME=$(kubectl -n kube-system get pods --field-selector spec.nodeName=${NODE_NAME} -ojsonpath='{.items[0].metadata.name}')
POD_NAME=$(kubectl -n kube-system get pods --field-selector spec.nodeName=${NODE_NAME} -ojsonpath='{.items[?(@.metadata.labels.name=="doks-debug")].metadata.name}')
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a better approach is to use the label that should uniquely identify doks-debug.

Personally, I generally prefer using custom columns over dealing with JSON whenever I can, so this is how I'd go about it:

POD_NAME=$(kubectl get pod -l name=doks-debug --field-selector spec.nodeName=${NODE_NAME} --no-headers -o custom-columns=:.metadata.name)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dhij could you check in on that? Take care to add -n kube-system still if you use Timo's command.

kubectl -n kube-system exec -it ${POD_NAME} bash
```

Expand Down