<p>So, i'm trying to work with kubernetes (minikube). I'm a total beginner, with some basic experience with docker.
It turns out, i installed kubernetes 2 days ago and haven't managed to do a single thing.
I barely managed to connect to the dashboard, and spent an ungodly amount of time finding how to get authenticated for that.</p>

<p>All i'm trying to do is to deploy a single docker image but I can't even do a basic hello world tutorial, as pretty much whatever command i type, i get an error message about not being authorized.</p>

<p>At the moment, I'm trying to write a deployment file, but i'm getting this "unauthorized" error as soon as i use "kubectl create".  I'm totally at a loss as to what to do.</p>

<p><strong>kubectl create -f deployment.yaml</strong> </p>

<pre><code>error: unable to recognize "deployment.yaml": Unauthorized
</code></pre>

<p>I don't know what information to give you. Here is the minikube status:</p>

<p><strong>minikube status</strong></p>

<pre><code>host: Running
kubelet: Running
apiserver: Running
kubectl: Correctly Configured: pointing to minikube-vm at 192.168.99.100
</code></pre>

<p><strong>Minikube version</strong> : v1.2.0</p>

<p><strong>Docker version</strong> :  18.06.3-ce, build d7080c1</p>

<p><strong>kubectl version</strong> :</p>

<pre><code>Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-19T16:40:16Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-19T16:32:14Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
</code></pre>

<p>Do you guys have any idea what to do? The issue here is really that i don't understand what is happening:
- Why do i need to authenticate?
- What do i need to authenticate myself against?
- Why is it not self evident what to do?</p>

<p>I find that most pages about the topic online are either outdated, or ask me to perform action that just end up returning "enable to recognize ... : Unauthorized". The tutorials online don't address this problem. They all seem to automatically be able to use "kubectl create" without any need for authentication.</p>

<p>Do you know what i'm supposed to do? Have you had this problem?</p>

<p>I solved the problem by deleting ~/.kube and removing the minikube and kubectl binaries at /usr/local/bin.</p>

<p>I re-downloaded and re-installed minikube and kubectl. I then launched <code>minikube start</code>, and everything is now working fine.</p>

<p>The origin of my problem seem to have been the installation of the dashboard. I followed some indications online, not knowing exactly what i was doing. In the process, i had to create some security roles, and something involving a token. I managed to connect to the dashboard, but from then on, every kubectl command told me that i was unauthorized.</p>
