When using Terraform to run kubectl
with local-exec provisioner under null_resource I get the following error:
exit status 1. Output: error: open /Users/myuser/.kube/config.lock: file exists
since I'm running the null_resource with count it looks like Terraforms spawns several kubectl
commands in parallel, and kubectl
doesn't like this.
Are you familiar with a way to serialize the command in a local-exec to prevent this issue? any other ideas?