<p>I am new to the world of Kubernetes. I am trying to deploy jupyter notebook inside the cluster. I have created kubernetes cluster with reference to official docs. The notebook says it will redirect to the home page once the spawning is finished. But jupyter pod got stuck after spawning sometime. </p>

<p><a href="https://i.stack.imgur.com/dVc2x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dVc2x.png" alt="jupyter pod got stuck after spawning sometime"></a></p>

<p>I referred similar issue in GitHub but couldn't find the answer. The referred link is <a href="https://github.com/kubeflow/kubeflow/issues/336" rel="nofollow noreferrer">Github Link</a></p>

<p>From the comments from the issue suggested that whether the jupyter hub uses the persistent disk. I ran those commands, seems persistent disk are attached.</p>

<blockquote>
  <p>kubectl -n default get po,svc,deploy,pv,pvc -o wide</p>
</blockquote>

<pre><code>    NAME                                 READY   STATUS      RESTARTS   AGE   IP          NODE                                             NOMINATED NODE
pod/deploy-ml-pipeline-csnx4-j556r   0/1     Completed   0          30m   10.60.1.6   gke-churnprediction-default-pool-142b8f7d-d4kv   &lt;none&gt;

NAME                 TYPE        CLUSTER-IP    EXTERNAL-IP   PORT(S)   AGE   SELECTOR
service/kubernetes   ClusterIP   10.63.240.1   &lt;none&gt;        443/TCP   32m   &lt;none&gt;

NAME                                                        CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                     STORAGECLASS   REASON   AGE
persistentvolume/pvc-57af1a5e-505d-11e9-9b66-42010a800130   10Gi       RWO            Delete           Bound    kubeflow/vizier-db        standard                27m
persistentvolume/pvc-70874d08-505d-11e9-9b66-42010a800130   10Gi       RWO            Delete           Bound    kubeflow/minio-pv-claim   standard                26m
persistentvolume/pvc-70b1712e-505d-11e9-9b66-42010a800130   10Gi       RWO            Delete           Bound    kubeflow/mysql-pv-claim   standard                26m
persistentvolume/pvc-86d45ad1-505d-11e9-9b66-42010a800130   10Gi       RWO            Delete           Bound    kubeflow/claim-madhi      standard                25m
</code></pre>

<p>This is the result of the above command which according to my knowledge persistent disk are successfully attached! I really don't know how it's internally working. So, I can't able to figure out what's the problem here. Can any explain the problem or provide the link of kubernetes architecture link? It will be helpful for me to understand the core concept behind the kubernetes.</p>

<p>Below is the command used to get description about pod</p>

<blockquote>
  <p>kubectl describe pod pod_name</p>
</blockquote>

<p><a href="https://i.stack.imgur.com/x4050.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x4050.png" alt="enter image description here"></a></p>

<p>to get the yaml file</p>

<blockquote>
  <p>kubectl get pod pod_name -o yaml</p>
</blockquote>

<p><a href="https://i.stack.imgur.com/jR0PH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jR0PH.png" alt="enter image description here"></a>
<a href="https://i.stack.imgur.com/2FWj9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2FWj9.png" alt="enter image description here"></a></p>

<p>I somewhat figured out the solution but I don't know either this is the exact solution or still there is a problem. As per the comment, there is no issue with the pod or other configuration files. I somewhat thought it might be the localhost problem. So, I tried changing the port from 8085 to 8081 and re-run the <strong>start_ui.sh</strong> script. The spawning error disappeared and it redirected me to the juypter working directory. </p>

<pre><code>kubectl port-forward -n ${NAMESPACE} $(kubectl get pods -n ${NAMESPACE} --selector=service=ambassador -o jsonpath='{.items[0].metadata.name}') 8081:80
</code></pre>

<p>And If you want to avoid all this problem, then the effective way is to the run the kubeflow in <strong>endpoints</strong> instead of localhost which eliminates all this problem. To view the dashboard at endpoints you need to setup the IAM access initially while creating a cluster.</p>
