Answers: <p>you might be missing a load balancer or try  <a href="http://127.0.0.1:31677/" rel="nofollow noreferrer">http://127.0.0.1:31677/</a></p>
  <p>&quot;https://minikube.sigs.k8s.io/docs/handbook/accessing/#loadbalancer-access</p>
  
Answers: CC BY-SA 4.0
Answers: 2024-12-28T15:37:38.200Z
Answers: I just studied at type NodePort, not LoadBalancer. So I want to resolve the issue with NodePort before continue with LoadBalancer
Answers: Chicky
Answers: CC BY-SA 4.0
Answers: 2024-12-28T15:23:34.927Z
Answers: 2024-12-28T15:24:25.433Z
Answers: 2024-12-28T15:24:25.433Z
Answers: d4n3sh
Body: <p>I'm learning k8s and following this tutorial: <a href="https://kubernetes.io/docs/tutorials/kubernetes-basics/expose/expose-intro/" rel="nofollow noreferrer">https://kubernetes.io/docs/tutorials/kubernetes-basics/expose/expose-intro/</a></p>
  <p>My PC: Macbook Pro M2</p>
  <p>Summary steps:</p>
  <ol>
  <li>Start K8S cluster</li>
  </ol>
  <blockquote>
  <p>minikube start</p>
  </blockquote>
  <ol start="2">
  <li>Create a deployment</li>
  </ol>
  <blockquote>
  <p>kubectl create deployment kubernetes-bootcamp --image=gcr.io/google-samples/kubernetes-bootcamp:v1</p>
  </blockquote>
  <ol start="3">
  <li>Expose deployment as a service</li>
  </ol>
  <blockquote>
  <p>kubectl expose deployment/kubernetes-bootcamp --type=&quot;NodePort&quot; --port 8080</p>
  </blockquote>
  <ol start="4">
  <li>Access the application</li>
  </ol>
  <blockquote>
  <p>kubectl get nodes -o wide // Get node ip INTERNAL-IP : 192.168.49.2 , EXTERNAL-IP : none</p>
  </blockquote>
  <blockquote>
  <p>kubectl get services kubernetes-bootcam // Get service port : 8080:31677/TCP</p>
  </blockquote>
  <blockquote>
  <p>curl <a href="http://192.168.49.2:31677" rel="nofollow noreferrer">http://192.168.49.2:31677</a> // NO response</p>
  </blockquote>
  <p>I don't know why I can't access to the service by this way.</p>
  <p>I tried to expose service by <code>kubectl port-forward deployments/kubernetes-bootcamp 8080:8080</code> or use minikube <code>minikube service kubernetes-bootcamp</code>, the both ways is worked.</p>
  
Tags: <docker><kubernetes><kubectl><minikube>
Title: How to access the application that's exposed by kubectl
UserDisplayName: Chicky
ThreadText: # How to access the application that's exposed by kubectl
  
  (Asked by: username_0 on 2024-12-28)
  
  I'm learning k8s and following this tutorial: <https://kubernetes.io/docs/tutorials/kubernetes-basics/expose/expose-intro/>
  
  My PC: Macbook Pro M2
  
  Summary steps:
  
  1. Start K8S cluster
  
  > minikube start
  
  2. Create a deployment
  
  > kubectl create deployment kubernetes-bootcamp --image=gcr.io/google-samples/kubernetes-bootcamp:v1
  
  3. Expose deployment as a service
  
  > kubectl expose deployment/kubernetes-bootcamp --type="NodePort" --port 8080
  
  4. Access the application
  
  > kubectl get nodes -o wide // Get node ip INTERNAL-IP : 192.168.49.2 , EXTERNAL-IP : none
  
  > kubectl get services kubernetes-bootcam // Get service port : 8080:31677/TCP
  
  > curl <http://192.168.49.2:31677> // NO response
  
  I don't know why I can't access to the service by this way.
  
  I tried to expose service by `kubectl port-forward deployments/kubernetes-bootcamp 8080:8080` or use minikube `minikube service kubernetes-bootcamp`, the both ways is worked.
  
  **Tags:** docker, kubernetes, kubectl, minikube
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-12-28. Score: 0
  
  you might be missing a load balancer or try <http://127.0.0.1:31677/>
  
  "https://minikube.sigs.k8s.io/docs/handbook/accessing/#loadbalancer-access
  
  > **Comments:**
  > **username_0**: I just studied at type NodePort, not LoadBalancer. So I want to resolve the issue with NodePort before continue with LoadBalancer  
  
  ---
  
  