Skip to content

Instantly share code, notes, and snippets.

@hexfusion
Forked from ironcladlou/jam-etcd.sh
Created September 8, 2020 21:41
Show Gist options
  • Save hexfusion/70b0c7e23f4bc74c751c26555d666217 to your computer and use it in GitHub Desktop.
Save hexfusion/70b0c7e23f4bc74c751c26555d666217 to your computer and use it in GitHub Desktop.
#!/bin/bash
choice=$(oc get --namespace openshift-etcd --selector etcd pods -o json | jq -r '.items[] | .spec.nodeName + " " + (.status.containerStatuses[] | select(.name=="etcd") | .containerID[8:])' | fzf)
IFS=' ' read node container_id <<< "$choice"
pid=$(oc debug --quiet nodes/$node -- chroot /host crictl inspect -o go-template --template '{{.info.pid}}' $container_id)
oc debug --quiet nodes/$node -- chroot /host strace -Tfe inject=fdatasync:delay_enter=800000 -e trace=fdatasync -p $pid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment