I am trying to delete evicted pod by Linux cron script,but getting below error
Script is root@k8> cat evicted.sh
!/bin/bash
date echo “Deleting Evcited Pod” /usr/local/bin/kubectl get po -A | grep Evicted | awk ‘{system ("kubectl -n " $1 " delete po " $2)}’
sh: kubectl: command not found sh: kubectl: command not found sh: kubectl: command not found sh: kubectl: command not found sh: kubectl: command not found sh: kubectl: command not found sh: kubectl: command not found sh: kubectl: command not found sh: kubectl: command not found sh: kubectl: command not found sh: kubectl: command not found sh: kubectl: command not found sh: kubectl: command not found sh: kubectl: command not found sh: kubectl: command not found sh: kubectl: command not found
So any idea ,how can I delete it by linux cron job or k8s cron by running a container