error when executing create_cluster.sh
What happened: I was deploying eke-distro on my Mac Pro.
I set KOPS_STATE_STORE and KOPS_CLUSTER_NAME as guide said. create_configuration.sh was successfully executed. then I executed create_cluster.sh, but error happened like below.
Found multiple arguments which look like a cluster name "xxx.xxx.com" (via flag) "xxx.xxx.com" (as argument)
This often happens if you specify an argument to a boolean flag without using =
For example: use --bastion=true or --bastion, not --bastion true
I found below article. As I understand, it is because I already set KOPS_CLUSTER_NAME as an environment variable. https://github.com/kubernetes/kops/issues/5967
Because there are two ways you can pass this to kops -- one is using an environment variable (which I think is the way the devs do it - hence the command returned at the end of the run doesn't have it) and the other is using the --name switch (which I do)
In short, if you have the cluster name included on an environment variable, then kops doesn't need the --name switch, if you don't have the environment variable, then you need the --name switch.
so I modified create_cluster.sh like this. then it worked.
set -eo pipefail
BASEDIR=$(dirname "$0")
source ${BASEDIR}/set_k8s_versions.sh
kops update cluster --yes
Is it right approach? or is there any other way to execute the script without error?
There is a PR out there that covers this, sorry about that. I had a hold on that because I was waiting for some other work, but I'll take the hold off https://github.com/aws/eks-distro/pull/92