Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

โ€œInvest in yourself โ€” your confidence is always worth it.โ€

Explore Cosmetic Hospitals

Start your journey today โ€” compare options in one place.

Minikube Tutorials: minikube tunnel explained


How to access applications running within minikube

There are two major categories of services in Kubernetes:

  • NodePort
  • LoadBalancer

NodePort access with Minikube

A NodePort service is the most basic way to get external traffic directly to your service. NodePort, as the name implies, opens a specific port, and any traffic that is sent to this port is forwarded to the service.

Getting the NodePort using the service command: We also have a shortcut for fetching the minikube IP and a serviceโ€™s NodePort:
$ minikube service –url


Example of NodePort

Step - 1: Create a Kubernetes deployment
$ kubectl create deployment hello-minikube1 --image=k8s.gcr.io/echoserver:1.4

Step - 2: Create a Kubernetes service type NodePort
$ kubectl expose deployment hello-minikube1 --type=NodePort --port=8080

Step - 3: Check Node Port
$ kubectl get svc
NAME              TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
hello-minikube1   NodePort    10.100.238.34   <none>        8080:31389/TCP   3s

Step - 4: Run service tunnel
$ minikube service hello-minikube1 --url

Step - 5: To determine the NodePort for your service, you can use a kubectl command like this (note that nodePort begins with lowercase n in JSON output):
$ kubectl get service <service-name> --output='jsonpath="{.spec.ports[0].nodePort}"'Code language: JavaScript (javascript)



Connect to LoadBalancer services with Minikube

A LoadBalancer service is the standard way to expose a service to the internet. With this method, each service gets its own IP address.

Using minikube tunnel
Services of type LoadBalancer can be exposed via the minikube tunnel command. It must be run in a separate terminal window to keep the LoadBalancer running. Ctrl-C in the terminal can be used to terminate the process at which time the network routes will be cleaned up

minikube tunnel creates a network route on the host to the service using the clusterโ€™s IP address as a gateway. The tunnel command exposes the external IP directly to any program running on the host operating system.

Note: The command requires root rights (sudo) because it creates a network configuration.

Tunnel is used to expose the service from inside of VM where minikube is running to the host machine’s network. Works with LoadBalancer service type.

Example of LoadBalancer with Minikube tunnel


Step 1 - Run the tunnel in a separate terminal

It will ask for a password.
$ minikube tunnel
minikube tunnel runs as a process, creating a network route on the host to the service CIDR of the cluster using the clusterโ€™s IP address as a gateway. The tunnel command exposes the external IP directly to any program running on the host operating system.

tunnel output example

 Password:
 Status:
 machine: minikube
 pid: 39087
 route: 10.96.0.0/12 -> 192.168.64.194
 minikube: Running
 services: [hello-minikube]
     errors:
   minikube: no errors
   router: no errors
   loadbalancer emulator: no errors


Step 2 - Create a Kubernetes deployment
$ kubectl create deployment hello-minikube1 --image=k8s.gcr.io/echoserver:1.4

Step 3 - Create a Kubernetes service with type LoadBalancer

kubectl expose deployment hello-minikube1 --type=LoadBalancer --port=8080

Step 4 - Check the external IP
$ kubectl get svc
$ kc get svc
 NAME              TYPE           CLUSTER-IP      EXTERNAL-IP     PORT(S)          AGE
 hello-minikube1   LoadBalancer   10.96.184.178   10.96.184.178   8080:30791/TCP   40s
 
Note that without minikube tunnel, Kubernetes will show the external IP as โ€œpendingโ€.

Step 5 - Try in your browser

Open in your browser (ensure there is no proxy set)

http://REPLACE_WITH_EXTERNAL_IP:8080
Each service will get its own external IP.Code language: JavaScript (javascript)

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services โ€” all in one place.

Explore Hospitals
Iโ€™m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at <a href="https://www.cotocus.com/">Cotocus</a>. I share tech blog at <a href="https://www.devopsschool.com/">DevOps School</a>, travel stories at <a href="https://www.holidaylandmark.com/">Holiday Landmark</a>, stock market tips at <a href="https://www.stocksmantra.in/">Stocks Mantra</a>, health and fitness guidance at <a href="https://www.mymedicplus.com/">My Medic Plus</a>, product reviews at <a href="https://www.truereviewnow.com/">TrueReviewNow</a> , and SEO strategies at <a href="https://www.wizbrand.com/">Wizbrand.</a> Do you want to learn <a href="https://www.quantumuting.com/">Quantum Computing</a>? <strong>Please find my social handles as below;</strong> <a href="https://www.rajeshkumar.xyz/">Rajesh Kumar Personal Website</a> <a href="https://www.youtube.com/TheDevOpsSchool">Rajesh Kumar at YOUTUBE</a> <a href="https://www.instagram.com/rajeshkumarin">Rajesh Kumar at INSTAGRAM</a> <a href="https://x.com/RajeshKumarIn">Rajesh Kumar at X</a> <a href="https://www.facebook.com/RajeshKumarLog">Rajesh Kumar at FACEBOOK</a> <a href="https://www.linkedin.com/in/rajeshkumarin/">Rajesh Kumar at LINKEDIN</a> <a href="https://www.wizbrand.com/rajeshkumar">Rajesh Kumar at WIZBRAND</a> <a href="https://www.rajeshkumar.xyz/dailylogs">Rajesh Kumar DailyLogs</a>

Related Posts

Top 10 Subscription Management Software Tools in 2026: Features, Pros, Cons & Comparison

Introduction Subscription management software is designed to streamline and optimize the process of managing recurring billing, customer subscriptions, and related business operations. In 2026, with the rapid…

Read More

Top 10 AI Data Integration Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, AI data integration tools are pivotal for businesses navigating the complexities of modern data ecosystems. These tools combine artificial intelligence with data integration processes…

Read More

Top 10 Fleet Management Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, the logistics and transportation industries are evolving rapidly, and managing a fleet of vehicles has never been more complex. Fleet management software has become…

Read More

Top 10 AI Academic Plagiarism Checkers Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, AI academic plagiarism checkers have become indispensable tools for students, educators, researchers, and institutions striving to uphold academic integrity. With the rise of AI-generated…

Read More

Top 10 Travel Management Software Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, travel management software (TMS) has become a crucial tool for businesses, travel agencies, and frequent travelers. These tools automate the booking, tracking, and management…

Read More

Top 10 No-Code Platforms Tools in 2026: Features, Pros, Cons & Comparison

Introduction In 2026, no-code platforms have become essential for businesses and individuals looking to build powerful applications, websites, and automations without the need for programming knowledge. These…

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x