<p>I've read the <a href="https://cloud.google.com/container-engine/docs/quickstart" rel="nofollow noreferrer">quick start guide</a> and I've got as far as</p>

<ul>
<li>I have a cluster</li>
<li>I can see that I need to type a <code>kubectl run</code> command to start my container.</li>
</ul>

<p>I want to start a publicly available docker container, which I can start on any docker-enabled machine with this command</p>

<pre><code>docker run -d \
   -e DRONE_SERVER=wss://ci.fommil.com/ws/broker \
   -e DRONE_SECRET=&lt;redacted&gt; \
   -e DOCKER_MAX_PROCS=1 \
   -e DRONE_TIMEOUT=30m \
   -v /var/run/docker.sock:/var/run/docker.sock \
   --restart=always \
   --name=drone-agent \
   drone/drone:0.5 agent
</code></pre>

<p>what is the equivalent Google Console / cubectl command? I've got as far as</p>

<pre><code>kubectl run agent \
  --image=drone/drone:0.5 \
  --env="DRONE_SERVER=wss://ci.fommil.com/ws/broker" \
  --env="DRONE_SECRET=&lt;redacted&gt;" \
  --env="DOCKER_MAX_PROCS=1" \
  --env="DRONE_TIMEOUT=30m" \
  -v /var/run/docker.sock:/var/run/docker.sock
</code></pre>

<p>but this <code>-v</code> line isn't quite right. I need to make sure that the <code>/var/run/docker.sock</code> is mounted in the container as the sole purpose of it is to launch sub-processes in docker to run CI jobs.</p>

<p>you're right, creating volumes using the <a href="https://kubernetes.io/docs/user-guide/kubectl/kubectl_create/" rel="nofollow noreferrer">imperative commands</a> to create volumes without config files isn't available in Kubernetes.</p>

<p>But it's easy to write some configuration. Based on this <a href="https://gc-taylor.com/blog/2015/10/27/example-drone-ci-kubernetes-manifests" rel="nofollow noreferrer">blog post</a> and your requirements a "modern" config might look like.</p>

<p>deployment.yml:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: agent
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: agent
    spec:
      containers:
      - env:
        - name: DRONE_SERVER
          value: "wss://ci.fommil.com/ws/broker"
        - name: DRONE_SECRET
          value: &lt;redacted&gt;
        - name: DOCKER_MAX_PROCS
          value: "1"
        - name: DRONE_TIMEOUT
          value: 30m
        image: drone/drone:0.5
        name: agent
        args: ["agent"]
        securityContext:
          privileged: true
        volumeMounts:
          - mountPath: /var/run/docker.sock
            name: docker-sock
          - mountPath: /var/lib/docker
            name: docker-lib
      volumes:
        - name: docker-sock
          hostPath:
            path: /var/run/docker.sock
        - name: docker-lib
          hostPath:
            path: /var/lib/docker
</code></pre>

<p>This could now be used with <code>kubectl create -f deployment.yml</code> and stopped with <code>kubectl delete deployments -l app=agent</code></p>
