<p>I would like to be able to get a description of my current state of the cluster so that in the future I would be able to recover from a failure. Aside from recreating all of the services from source/cli individually, what solutions are available?</p>

<p>Update: this is a really old method. We now have much better tools to backup k8s clusters, like <a href="https://heptio.github.io/velero/v0.11.0/" rel="nofollow noreferrer">velero</a></p>

<p>I'm using a bash script from CoreOS team, with small adjustments, that works pretty good. I'm using it more for cluster migration, but at some level can be used for backups too.</p>

<pre><code>for ns in $(kubectl get ns --no-headers | cut -d " " -f1); do
  if { [ "$ns" != "kube-system" ]; }; then
  kubectl --namespace="${ns}" get --export -o=json svc,rc,rs,deployments,cm,secrets,ds,petsets | \
jq '.items[] |
    select(.type!="kubernetes.io/service-account-token") |
    del(
        .spec.clusterIP,
        .metadata.uid,
        .metadata.selfLink,
        .metadata.resourceVersion,
        .metadata.creationTimestamp,
        .metadata.generation,
        .status,
        .spec.template.spec.securityContext,
        .spec.template.spec.dnsPolicy,
        .spec.template.spec.terminationGracePeriodSeconds,
        .spec.template.spec.restartPolicy
    )' &gt;&gt; "./my-cluster.json"
  fi
done
</code></pre>

<p>In case you need to revocer the state after, you just need to execute <code>kubectl create -f ./my-cluster.json</code></p>
