<p>Using fleet I can specify a command to be run inside the container when it is started. It seems like this should be easily possible with Kubernetes as well, but I can't seem to find anything that says how. It seems like you have to create the container specifically to launch with a certain command.</p>

<p>Having a general purpose container and launching it with different arguments is far simpler than creating many different containers for specific cases, or setting and getting environment variables.</p>

<p>Is it possible to specify the command a kubernetes pod runs within the Docker image at startup? </p>

<p>I spend 45 minutes looking for this. Then I post a question about it and find the solution 9 minutes later.</p>

<p>There is an hint at what I wanted inside the Cassandra <a href="https://github.com/kubernetes/examples/tree/master/cassandra" rel="noreferrer">example</a>. The <code>command</code> line below the image:</p>

<pre><code>id: cassandra
kind: Pod
apiVersion: v1beta1
desiredState:
  manifest:
    version: v1beta1
    id: cassandra
    containers:
      - name: cassandra
        image: kubernetes/cassandra
        command:
          - /run.sh
        cpu: 1000
        ports:
          - name: cql
            containerPort: 9042
          - name: thrift
            containerPort: 9160
        env:
          - key: MAX_HEAP_SIZE
            value: 512M
          - key: HEAP_NEWSIZE
            value: 100M
labels:
  name: cassandra
</code></pre>

<p>Despite finding the solution, it would be nice if there was somewhere obvious in the Kubernetes project where I could see <strong>all</strong> of the possible options for the various configuration files (pod, service, replication controller).</p>
