I have a Jenkins file as like below:
stage("Deploy artifact for k8s sync") { sh \'\'\' ns_exists=`kubectl get ns | grep ${ta