I was wondering if someone could point me in the right direction, I am looking at verbalising our Kubernetes version within our Terraform module as currently its hard coded.
Every now and then we get an error saying that our "orchestration version" isn't valid when we deploy our cluster - this is due to Azure dropping our Kubernetes version... (We deploy our dev/uat envs daily)
So I came up with the idea of using a variable for our version so we can always deploy avoiding the "invalid orchestration" error. I scripted the bash script for what I need;
az aks get-versions --location westeurope --query 'orchestrators' -o tsv | awk '{print $3}' | tail -2 | head -n 1
But now I wish to use the output from ^^^ to use as our Kubernetes version within our Terraform module we deploy daily.
Can anyone point me in the right direction?
I've had a look at using build-args within the docker container.
variable=$( command | command | head -n1 )?