Skip to content

Instantly share code, notes, and snippets.

@ironcladlou
Created September 8, 2020 18:27
Show Gist options
  • Select an option

  • Save ironcladlou/2417f1b288576abe409e20dec6dce12c to your computer and use it in GitHub Desktop.

Select an option

Save ironcladlou/2417f1b288576abe409e20dec6dce12c to your computer and use it in GitHub Desktop.

Revisions

  1. ironcladlou created this gist Sep 8, 2020.
    7 changes: 7 additions & 0 deletions jam-etcd.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    #!/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