<p>I want to run a kloudless docker image with the command below in kubernetes. Just wanted to know it there was any straightforward solution. </p>

<pre><code>docker run -d \
  --privileged
  --tmpfs /run  --tmpfs /run/lock  --tmpfs /tmp \
  --volume /sys/fs/cgroup:/sys/fs/cgroup:ro \
  --ulimit nofile=1024000:1024000 \
  --sysctl net.ipv4.ip_local_port_range='1025 65535' \
  --name kenterprise \
  --env KLOUDLESS_CONFIG="$(cat kloudless.yml)" \
  # [ports,/data volume|db config] \
  docker.kloudless.com/prod:1.29.0  docker_entry
</code></pre>

<p>I know we can run docker image in kubernetes with similar configure by configuring the container in pod yaml. Example if I wanted to give --privileged argument I could </p>

<pre><code>containers:
    securityContext:
      privileged: true
</code></pre>

<p>Just wanted to know if there are any straightforward way.</p>

<p>kubectl run <em>used</em> to exist. It was probably what you were looking for. <a href="https://github.com/LevelUpEducation/kubernetes-demo/issues/31" rel="nofollow noreferrer">But it is depecrated now</a>.</p>

<p><code>kubectl run -i --tty load-generator --image=busybox /bin/sh</code></p>

<p>The closest thing to running a pod/deployment from the command line without creating a file I could find is <code>kubectl create</code></p>

<pre><code>kubectl create deployment prod --image=busybox -o yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    app: prod
  name: prod
spec:
  replicas: 1
  selector:
    matchLabels:
      app: prod
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: prod
    spec:
      containers:
      - image: busybox
        name: busybox
        resources: {}
status: {}
</code></pre>

<p>Although, I would strongly advise against running one off commands like this as it goes against the concept of <a href="https://en.wikipedia.org/wiki/Infrastructure_as_code" rel="nofollow noreferrer">infrastructure as code</a> which Kubernetes encourages through the use of manifests.</p>

<p>Using manifests in a Version Control System such as git allows you to explore the history of your commands and deployments easily and manage branches of changes to your deployment.</p>

<p>However, if what you are looking to do is abstract your deployment so that users don't have to get their hands dirty with the internals, then I would recommend a tool like <a href="https://helm.sh/" rel="nofollow noreferrer">Helm</a>, which allows you to create charts and change simple values at release time like so:</p>

<p><code>helm install --set foo=bar ./mychart</code></p>
