<p>I am beginner to kubernetes. I am trying to install minikube wanted to run my application in kubernetes. I am using ubuntu 16.04</p>

<p>I have followed the installation instructions provided here
<a href="https://kubernetes.io/docs/setup/learning-environment/minikube/#using-minikube-with-an-http-proxy" rel="noreferrer">https://kubernetes.io/docs/setup/learning-environment/minikube/#using-minikube-with-an-http-proxy</a></p>

<p>Issue1:
After installing kubectl, virtualbox and minikube I have run the command</p>

<pre><code>minikube start --vm-driver=virtualbox
</code></pre>

<p>It is failing with following error</p>

<pre><code>Starting local Kubernetes v1.10.0 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
E0912 17:39:12.486830   17689 start.go:305] Error restarting 
cluster:  restarting kube-proxy: waiting for kube-proxy to be 
up for configmap update: timed out waiting for the condition
</code></pre>

<p>But when I checked the virtualbox I see the minikube VM running and when I run the kubectl</p>

<pre><code>kubectl create deployment hello-minikube --image=k8s.gcr.io/echoserver:1.10

</code></pre>

<p>I see the deployments</p>

<pre><code> kubectl get deployment
NAME             DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
hello-minikube   1         1         1            1           27m
</code></pre>

<p>I exposed the hello-minikube deployment as service</p>

<pre><code>kubectl get service
NAME             TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE
hello-minikube   LoadBalancer   10.102.236.236   &lt;pending&gt;     8080:31825/TCP   15m
kubernetes       ClusterIP      10.96.0.1        &lt;none&gt;        443/TCP          19h

</code></pre>

<p>I got the url for the service</p>

<pre><code>minikube service hello-minikube --url
http://192.168.99.100:31825
</code></pre>

<p>When I try to curl the url I am getting the following error</p>

<pre><code>curl http://192.168.99.100:31825
curl: (7) Failed to connect to 192.168.99.100 port 31825: Connection refused

</code></pre>

<p>1)If minikube cluster got failed while starting, how did the kubectl able to connect to minikube to do deployments and services?
2) If cluster is fine, then why am i getting connection refused ?</p>

<p>I was looking at this proxy(<a href="https://kubernetes.io/docs/setup/learning-environment/minikube/#starting-a-cluster" rel="noreferrer">https://kubernetes.io/docs/setup/learning-environment/minikube/#starting-a-cluster</a>) what is my_proxy in this ?</p>

<p>Is this minikube ip and some port ?</p>

<p>I have tried this</p>

<p><a href="https://stackoverflow.com/questions/52300055/error-restarting-cluster-restarting-kube-proxy-waiting-for-kube-proxy-to-be-up">Error restarting cluster: restarting kube-proxy: waiting for kube-proxy to be up for configmap update: timed out waiting for the condition</a></p>

<p>but do not understand how #3(set proxy) in solution will be done. Can some one help me getting instructions for proxy ?</p>

<p>Adding the command output which was asked in the comments</p>

<pre><code>kubectl get po -n kube-system
NAME                                    READY   STATUS    RESTARTS   AGE
etcd-minikube                           1/1     Running   0          4m
kube-addon-manager-minikube             1/1     Running   0          5m
kube-apiserver-minikube                 1/1     Running   0          4m
kube-controller-manager-minikube        1/1     Running   0          6m
kube-dns-86f4d74b45-sdj6p               3/3     Running   0          5m
kube-proxy-7ndvl                        1/1     Running   0          5m
kube-scheduler-minikube                 1/1     Running   0          5m
kubernetes-dashboard-5498ccf677-4x7sr   1/1     Running   0          5m
storage-provisioner                     1/1     Running   0          5m

</code></pre>

VSK
<blockquote>
  <p>I deleted minikube and removed all files under ~/.minikube and
  reinstalled minikube. Now it is working fine. I did not get the output
  before but I have attached it after it is working to the question. Can
  you tell me what does the output of this command tells ?</p>
</blockquote>

<p>It will be very difficult or even impossible to tell what was exactly wrong with your <strong>Minikube Kubernetes cluster</strong> when it is already removed and set up again.</p>

<p>Basically there were a few things that you could do to properly troubleshoot or debug your issue.</p>

<blockquote>
  <p>Adding the command output which was asked in the comments</p>
</blockquote>

<p>The output you posted is actually only part of the task that @Eduardo Baitello asked you to do. <code>kubectl get po -n kube-system</code> command simply shows you a list of <code>Pods</code> in <code>kube-system</code> namespace. In other words this is the list of system pods forming your Kubernetes cluster and, as you can imagine, proper functioning of each of these components is crucial. As you can see in your output the <code>STATUS</code> of your <code>kube-proxy</code> pod is <code>Running</code>:</p>

<pre><code>kube-proxy-7ndvl                        1/1     Running   0          5m
</code></pre>

<p>You were also asked in @Eduardo's question to check its logs. You can do it by issuing:</p>

<pre><code>kubectl logs kube-proxy-7ndvl
</code></pre>

<p>It could tell you what was wrong with this particular pod at the time when the problem occured. Additionally in such case you may use <code>describe</code> command to see other pod details (sometimes looking at pod events may be very helpful to figure out what's going on with it):</p>

<pre><code>kubectl describe pod kube-proxy-7ndvl
</code></pre>

<p>The suggestion to check this particular <code>Pod</code> status and logs was most probably motivated by this fragment of the error messages shown during your Minikube startup process:</p>

<pre><code>E0912 17:39:12.486830   17689 start.go:305] Error restarting 
cluster:  restarting kube-proxy: waiting for kube-proxy to be 
up for configmap update: timed out waiting for the condition
</code></pre>

<p>As you can see this message clearly suggests that there is in short "something wrong" with <code>kube-proxy</code> so it made a lot of sense to check it first.</p>

<p>There is one more thing you may have not noticed:</p>

<pre><code>kubectl get service
NAME             TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE
hello-minikube   LoadBalancer   10.102.236.236   &lt;pending&gt;     8080:31825/TCP   15m
kubernetes       ClusterIP      10.96.0.1        &lt;none&gt;        443/TCP          19h
</code></pre>

<p>Your <code>hello-minikube</code> service was not completely ready. In <code>EXTERNAL-IP</code> column you can see that its state was <code>pending</code>. As you can use <code>describe</code> command to describe <code>Pods</code> you can do so to get details of the service. Simple:</p>

<pre><code>describe service hello-minikube
</code></pre>

<p>could tell you quite a lot in such case.</p>

<blockquote>
  <p>1)If minikube cluster got failed while starting, how did the kubectl
  able to connect to minikube to do deployments and services? 2) If
  cluster is fine, then why am i getting connection refused ?</p>
</blockquote>

<p>Remember that <strong>Kubernetes Cluster</strong> is not a monolith structure and consists of many parts that depend on one another. The fact that <code>kubectl</code> worked and you could create deployment doesn't mean that the whole cluster was working fine and as you can see in the error message it was suggesting that one of its components, namely <code>kube-proxy</code>, could actually not function properly.</p>

<p>Going back to the beginning of your question...</p>

<blockquote>
  <p>I have followed the installation instructions provided here
  <a href="https://kubernetes.io/docs/setup/learning-environment/minikube/#using-minikube-with-an-http-proxy" rel="noreferrer">https://kubernetes.io/docs/setup/learning-environment/minikube/#using-minikube-with-an-http-proxy</a></p>
  
  <p>Issue1: After installing kubectl, virtualbox and minikube I have run
  the command</p>

<pre><code>minikube start --vm-driver=virtualbox
</code></pre>
</blockquote>

<p>as far as I understood you don't use the http proxy so you didn't follow instructions from this particular fragment of the docs that you posted, did you ? </p>

<p>I have the impression that you mix 2 concepts. <code>kube-proxy</code> which is a <code>Kubernetes cluster</code> component and which is deployed as pod in <code>kube-system</code> space and <a href="https://en.wikipedia.org/wiki/Proxy_server#Web_proxy_servers" rel="noreferrer">http proxy server</a> mentioned in <a href="https://kubernetes.io/docs/setup/learning-environment/minikube/#using-minikube-with-an-http-proxy" rel="noreferrer">this</a> fragment of documentation. </p>

<blockquote>
  <p>I was looking at this
  proxy(<a href="https://kubernetes.io/docs/setup/learning-environment/minikube/#starting-a-cluster" rel="noreferrer">https://kubernetes.io/docs/setup/learning-environment/minikube/#starting-a-cluster</a>)
  what is my_proxy in this ?</p>
</blockquote>

<p>If you don't know what is your <a href="https://en.wikipedia.org/wiki/Proxy_server#Web_proxy_servers" rel="noreferrer">http proxy</a> address, most probably you simply don't use it and if you don't use it to connect to the Internet from your computer, <strong><em>it doesn't apply to your case in any way</em></strong>. </p>

<p>Otherwise you need to set it up for your <strong>Minikube</strong> by <a href="https://kubernetes.io/docs/setup/learning-environment/minikube/#using-minikube-with-an-http-proxy" rel="noreferrer">providing additional flags when you start it</a> as follows:</p>

<pre><code>minikube start --docker-env http_proxy=http://$YOURPROXY:PORT \
                 --docker-env https_proxy=https://$YOURPROXY:PORT
</code></pre>

<p>If you were able to start your <strong>Minikube</strong> and now it works properly only using the command:</p>

<pre><code>minikube start --vm-driver=virtualbox
</code></pre>

<p>your issue was caused by something else and <em>you don't need to provide the above mentioned flags to tell your <strong>Minikube</strong> what is your http proxy server that you're using</em>.</p>

<p>As far as I understand currently everything is up and running and you can access the url returned by the command <code>minikube service hello-minikube --url</code> without any problem, right ? You can also run the command <code>kubectl get service hello-minikube</code> and check if its output differs from what you posted before. As you didn't attach any yaml definition files it's difficult to tell if it was nothing wrong with your service definition. Also note that <code>Load Balancer</code> is a service type designed to work with external load balancers provided by cloud providers and minikube uses <code>NodePort</code> instead of it.</p>
