<p>I'm on <strong>macOS Catalina 10.15.4</strong>, and I'm using <strong>minikube v1.11.0</strong> and <strong>kubernetes v1.18.3</strong>, both installed from brew. Minikube is initialized with the docker engine.</p>
<p>The initialization command is set up like so:</p>
<pre><code>      containers:
        - name: database
          image: &quot;mysql:5.6&quot;
          imagePullPolicy: IfNotPresent
          env:
            - name: MYSQL_ROOT_PASSWORD
              value: 12345
            - name: MYSQL_USER
              value: user
            - name: MYSQL_PASSWORD
              value: password
            - name: MYSQL_DATABASE
              value: db
</code></pre>
<p><strong>I'm trying to get a bash script open for one of my running kubectl containers.</strong> From research online, it appears that this should be the command that will open a bash window in my terminal:</p>
<p><code>minikube kubectl exec -it --namespace=tools test-pod -- bash</code></p>
<p><strong>However, when I run it, I get the following traceback:</strong></p>
<p><code>Error: unknown shorthand flag: 'i' in -it See 'minikube kubectl --help' for usage.</code></p>
<p><strong>It doesn't seem to want me using any arguments in my command.</strong> Is there something I'm missing, or am I attempting to use a command that is deprecated?</p>
<p><strong>Note: I am able to run</strong> <code>exec</code>, but not for opening a bash script. For example, I am able to run the following command:</p>
<p><code>minikube kubectl exec test-pod -- ls /</code></p>
<p>And it outputs this following:</p>
<pre><code>kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl kubectl exec [POD] -- [COMMAND] instead.
bin
boot
dev
docker-entrypoint-initdb.d
entrypoint.sh
etc
home
lib
lib64
media
mnt
opt
proc
root
run
sbin
srv
sys
tmp
usr
var
</code></pre>
<p><strong>Edit:</strong> I have attempted the following command:</p>
<pre><code>minikube kubectl exec --stdin --tty --namespace=tools test-pod -- sh
</code></pre>
<p>And I got the following traceback:</p>
<pre><code>Error: unknown flag: --stdin
See 'minikube kubectl --help' for usage.
</code></pre>
<p>It seems like any flags at all, short or long, are failing, and I cannot figure out why they wouldn't be.</p>

Ethan Hill
<p><code>minikube kubectl</code> needs the <code>--</code> after the command when you want to use it with arguments:</p>
<pre class="lang-sh prettyprint-override"><code>$ minikube kubectl -- exec --stdin --tty --namespace=tools test-pod -- sh
</code></pre>
<p>You can also use plain <code>kubectl</code></p>
<p>If would just make sure that your <code>~/.kube/config</code> is pointing to the right minikube context/cluster. Typically, any minikube command you run from the shell will cause it to change the context to your minikube cluster. i.e <code>minikube ssh</code></p>
<p>Then just use <code>kubectl</code></p>
<pre class="lang-sh prettyprint-override"><code>$ kubectl exec --stdin --tty --namespace=tools test-pod -- sh
</code></pre>
