Is there a way to fully script the creation of a cluster with Kops? Each time I've created a cluster, I've edited part of the default install with kops edit cluster ${NAME} and the like.
A bit tricky IMHO, you basically override EDITOR variable with your own script.
You can look at how prometheus guys doing it (https://github.com/prometheus/prombench)
@pluttrell Take a look at: https://github.com/kubernetes/kops/blob/master/docs/cli/kops_create.md
kops create -f FILENAME will let you predefine a kops cluster spec and then create it in one scripted action. One little trick that I think may not (yet!) be fully documented, you need a cluster spec AND the instance group specs to fully create the cluster.
You can get example cluster and IG specs by using:
kops get cluster -o yaml --full and kops get instancegroups <instancegroup> -o yaml.
I think this is basically a documentation issue, so I'm going to close it and cross-reference some of the open docs issues that this is related to. If you have any further questions, please check out the kubernetes slack, #kops channel.
Related issues: #1732, #1735, #267, #752
@geojaz Is it the expected behaviour that kops create -f FILENAME doesn't create the certificates, addons?

@tothandras That is basically correct. I forgot to mention that you at least need to create the sshpublickey secret. As a general outline as to how one might think about the logic needed to script this, consider the following:
First I will kops create -f <clusters_spec with instance groups>.
Then I will kops create secret --name <clustername> sshpublickey admin -i ~/.ssh/key.pub.
Then kops update cluster $CLUSTER_NAME --yes.
Then I can use kops validate cluster $CLUSTER_NAME.
And when I see that the cluster is ready, I would have a script that would apply any add-ons that you may need to consider the cluster fully bootstrapped. kops take a sort of hands off approach the add-ons. It makes them available for you, but doesn't apply them automatically.
Most helpful comment
@tothandras That is basically correct. I forgot to mention that you at least need to create the sshpublickey secret. As a general outline as to how one might think about the logic needed to script this, consider the following:
First I will
kops create -f <clusters_spec with instance groups>.Then I will
kops create secret --name <clustername> sshpublickey admin -i ~/.ssh/key.pub.Then
kops update cluster $CLUSTER_NAME --yes.Then I can use
kops validate cluster $CLUSTER_NAME.And when I see that the cluster is ready, I would have a script that would apply any add-ons that you may need to consider the cluster fully bootstrapped. kops take a sort of hands off approach the add-ons. It makes them available for you, but doesn't apply them automatically.