<p>In order to run a load test of an application I’m developing, I’m creating a Google Container Engine (GKE) cluster, create a couple of persistent disks, run a whole bunch of kubectl commands, run my benchmark, save the results, then delete the GKE cluster again.</p>

<p>The kubectl commands are responsible for labeling a subset of nodes of the GKE cluster (to guarantee that they only run my application, whereas the benchmark infrastructure is on the remainder of nodes) and creating secrets, replication controllers and services.</p>

<p>I’m looking for a way to automate all of this. I know that I could write a custom program which does all of this for me, but I’m wondering if there already is such a program.</p>

<p>I’ve briefly looked into <a href="https://www.terraform.io/" rel="nofollow">https://www.terraform.io/</a>, but it looks like that would only cover the GKE setup, not the Kubernetes resources.</p>

<p>Is the way to go to combine terraform and a script which runs kubectl commands? Or are there other tools for orchestrating Kubernetes?</p>

<p>Check out <a href="https://cloud.google.com/deployment-manager/docs/" rel="nofollow">Cloud Deployment Manager</a>. It allows you to declaratively create a GKE cluster and then adding resources to the cluster. I'm not sure if it will label the nodes for you. To accomplish that, one option is to create multiple <a href="https://cloudplatform.googleblog.com/2016/05/introducing-Google-Container-Engine-GKE-node-pools.html" rel="nofollow">node pools</a>. Each node pool will be automatically labeled with the name of the node pool, which should help you reduce the number of manual <code>kubectl</code> commands that you need to run. </p>
