<p>I have one docker image and I am using following command to run it. </p>

<pre><code>docker run -it -p 1976:1976 --name demo demo.docker.cloud.com/demo/runtime:latest
</code></pre>

<p>I want to run the same in Kubernetes. This is my current yaml file.</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>apiVersion: v1
kind: Deployment
metadata:
  name: demo-deployment
  labels:
    app: demo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: demo
  template:
    metadata:
      labels:
        app: demo
    spec:
      containers:
      - name: demo
        image: demo.docker.cloud.com/demo/runtime:latest
        ports:
        - containerPort: 1976
        imagePullPolicy: Never</code></pre>
</div>
</div>
</p>

<p>This yaml file covers everything except flag "-it". I am not able to find its Kubernetes equivalent. Please help me out with this. Thanks</p>

<p>I assume you are trying to connect a shell to your running container.  Following the guide at <a href="https://kubernetes.io/docs/tasks/debug-application-cluster/get-shell-running-container/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/debug-application-cluster/get-shell-running-container/</a> - You would need the following commands.  To <code>apply</code> your above configuration:</p>

<p>Create the pod: <code>kubectl apply -f ./demo-deployment.yaml</code></p>

<p>Verify the Container is running: <code>kubectl get pod demo-deployment</code></p>

<p>Get a shell to the running Container: <code>kubectl exec -it demo-deployment -- /bin/bash</code></p>
