Skip to content

Instantly share code, notes, and snippets.

@r3code
Last active August 12, 2022 08:57
Show Gist options
  • Save r3code/b329b2b7857348d80a8fa1be0c1b57c6 to your computer and use it in GitHub Desktop.
Save r3code/b329b2b7857348d80a8fa1be0c1b57c6 to your computer and use it in GitHub Desktop.
Kubernetes kubectl полезные команды

Kubernetes kubectl полезные команды

CronJob в Kubernetes

Поиск

**Найти под по IP адресу **

kubectl get pods -o custom-columns=:metadata.name --no-headers=true --field-selector status.podIP=

Список расписаний всех CronJob

k get cronjobs --output jsonpath="{range .items[*]}{.metadata.name}{': '}{.spec.schedule}{'\n'}{end}"

Расписание указанной CronJob

k get cronjob job_name 

Время последнего успешного завершения CronJob

kubectl get job -l component= -n -o json |
jq -r '.items[] | select(.status.succeeded) | .status.completionTime' |
sort -r | head -n 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment