Skip to content

Instantly share code, notes, and snippets.

@TinyExplosions
Last active May 28, 2020 13:59
Show Gist options
  • Save TinyExplosions/6020d48c1347af116afee763451cdf89 to your computer and use it in GitHub Desktop.
Save TinyExplosions/6020d48c1347af116afee763451cdf89 to your computer and use it in GitHub Desktop.
This is taken directly from Jorgen Dahle Naess' work to open the machine config daemon log for a certain host,
#!/bin/bash
mcdlog(){
host=$1
ns=openshift-machine-config-operator
podname=$(oc get pods -o wide --no-headers -n ${ns}| grep ${host} | egrep ^machine-config-daemon | awk '{ print $1 }')
oc logs -f ${podname} -c machine-config-daemon -n ${ns}
}
mcslog(){
host=$1
ns=openshift-machine-config-operator
podname=$(oc get pods -o wide --no-headers -n ${ns}| grep ${host} | egrep ^machine-config-server | awk '{ print $1 }')
oc logs -f ${podname} -n ${ns}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment