Skip to content

Instantly share code, notes, and snippets.

@knil-sama
Created October 23, 2018 13:18
Show Gist options
  • Select an option

  • Save knil-sama/8ca406e966510b2b71b4124a31520b3e to your computer and use it in GitHub Desktop.

Select an option

Save knil-sama/8ca406e966510b2b71b4124a31520b3e to your computer and use it in GitHub Desktop.
cronjob_log() {
echo $(kubectl get pods --selector=job-name="${1}" --output=jsonpath={.items..metadata.name})
}
job_log() {
echo $( kubectl get job | grep "${1}" | tail -n 1 | cut -d" " -f 1 | xargs kubectl describe job | grep SuccessfulCreate | tr -s ' ' | cut -d" " -f 8 | xargs kubectl logs)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment