<p>I have been digging through the Kubernetes documentation for hours.  I understand the core design, and the notion of services, controllers, pods, etc.  </p>

<p>What I don't understand, however, is the process in which I can declaratively configure the cluster.  That is, a way for me to write a config file (or a set thereof) to define the makeup, and scaling options of the cloud deployment.  I want to be able to declare which containers I want in which pods, how they will communicate, how they will scale, etc. without running a ton of cli commands.</p>

<p><strong><em>Is there <a href="https://docs.docker.com/compose/overview/" rel="noreferrer">docker-compose</a> functionality for Kubernetes?</em></strong></p>

<p>I want my application to be defined in git—to be version controlled–without relying on manual cli interactions. </p>

<p>Is this possible to do in a concise way?  Is there a reference that is more clear than the official documentation?</p>

<p>If you're still looking, maybe this tool can help: <a href="https://github.com/kelseyhightower/compose2kube" rel="noreferrer">https://github.com/kelseyhightower/compose2kube</a></p>

<p>You can create a compose file:</p>

<pre><code># sample compose file with 3 services
web:
  image: nginx
  ports:
    - "80"
    - "443"
database:
  image: postgres
  ports:
    - "5432"
cache:
  image: memcached
  ports:
    - "11211"
</code></pre>

<p>Then use the tool to convert it to kubernetes objects:</p>

<pre><code>compose2kube -compose-file docker-compose.yml -output-dir output
</code></pre>

<p>Which will create these files:</p>

<pre><code>output/cache-rc.yaml
output/database-rc.yaml
output/web-rc.yaml
</code></pre>

<p>Then you can use <code>kubectl</code> to apply them to kubernetes.</p>
