<p>I am using <code>minikube</code> for deployment in my local machine.
I am deploying an app with help of helm charts. My deployment script looks like</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ template &quot;app.fullname&quot; . }}
spec:
  replicas: {{ .Values.replicaCount }}
    spec:
      volumes:
          - name: dockersock
            hostPath:
                path: &quot;/var/run/docker.sock&quot;
      containers:
        - name: {{ .Chart.Name }}
          image: &quot;{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}&quot;
          imagePullPolicy: {{ .Values.image.pullPolicy }}
          volumeMounts:
              - name: dockersock
                mountPath: &quot;/var/run/docker.sock&quot;
          command: [&quot;/bin/sh&quot;, &quot;-c&quot;]
          args:
            - python3 runMyApp.py;
          resources:
            limits:
              nvidia.com/gpu: {{ .Values.numGpus }}
</code></pre>
<p>My script <code>runMyApp.py</code> when executed launch 4 other containers and I want that Kubernetes deploy them as well at minikube and this is expected behavior from my understanding. <br>
But When I  other 4 containers they were deployed on host machine, just like I executed some <code>docker run</code> command on my host machine. <br>
To verify that I was not mistaken,
so I tried to access them through other application using which is in minikube cluster but I couldn't. Then I tried accessing the application from the local environment and I was able to do that.
<br>
Is there any flaw in my understanding. If the behaviour is expected then what can I do to deploy other application in <code>k8s</code> as well.</p>

Pranjal Doshi
<p>In order to create new pods from within your python script, you should use the Kubernetes Python client library: <a href="https://github.com/kubernetes-client/python" rel="nofollow noreferrer">https://github.com/kubernetes-client/python</a> .</p>
<p>When you running docker run inside your script, kubernetes isn't aware of those containers, and they are just orphand containers running on your node host machine.</p>
