<p>My apologies if this question sounds obvious, but the Kubernetes and Google cloud documentation is extremely confusing and contradictory in places.</p>

<p>Anyway, I have pushed a Dockerized web-server to my private Google Container Registry. I want this container to be restarted if it dies, but I only need one single instance to be running at any given moment.  Moreover, there's a bunch of environment variables that need to be defined for the server to be correctly configured.</p>

<p>I have already created a new cluster. But where do I go from here? Some tutorials say one should declare pod and service files, but then the next tutorial says one shouldn't declare pods directly but use deployments instead. The result is that I'm terribly confused.</p>

<p>What's the best approach for this simple use case? Also, what is the recommended documentation for using Kubernetes in Google Cloud? (Google's official docs seem out of date.)</p>

<p>Based on your description, I would suggest you use a <a href="http://kubernetes.io/docs/user-guide/deployments/" rel="noreferrer">Deployment</a> with <code>replicas</code> set to 1. The Deployment will ensure that there is always one instance of your pod running. You can define your <a href="http://kubernetes.io/docs/user-guide/configuring-containers/#environment-variables-and-variable-expansion" rel="noreferrer">environment variables</a> in the <a href="http://kubernetes.io/docs/user-guide/deployments/#pod-template" rel="noreferrer">pod template</a> spec of your Deployment manifest.</p>

<p>In the documentation, you might also see suggestions to use <a href="http://kubernetes.io/docs/user-guide/replication-controller/" rel="noreferrer">replication controllers</a> for the same purpose. This is definitely an option but Deployments are considered the <a href="http://kubernetes.io/docs/user-guide/deployments/#what-is-a-deployment" rel="noreferrer">successor</a> to replication controllers and are usually <a href="http://kubernetes.io/docs/user-guide/replication-controller/#deployment-recommended" rel="noreferrer">recommended</a> at this point.</p>

<p>A bare pod is not intended to be <a href="http://kubernetes.io/docs/user-guide/pods/#durability-of-pods-or-lack-thereof" rel="noreferrer">durable</a> and will not be restarted in the case of a node failure or other type of eviction.</p>

<p>The documentation is out-of-date in many places but, as far as I know, the authoritative location (even for GKE) is <a href="http://kubernetes.io/docs/" rel="noreferrer">http://kubernetes.io/docs/</a>.</p>
