Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 7144

Can `kubectl wait` work for secrets generated by deployment? If not, any alternative in bash?

$
0
0

I try to use bash script to run a few k8s commands. During the deployment, I need to wait for a secret to be generated by cert-manager or Vault before it can continue. I know there is a command called kubectl wait but it doesn't seem to work with secret resources, so I came up with this bash script:

  while [ -z "$matched" ]  do    echo "Waiting for ($secret_name) to be created"    matched=$(kubectl get secret $secret_name -n $namespace -o jsonpath="{$path}" --ignore-not-found=true)    sleep 10;  done

But it fails on first run after waiting for a minute. It only works on second try. Do you have any suggestions?


Viewing all articles
Browse latest Browse all 7144

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>