Steps to access the POD from outside the cluster

access the POD from outside the cluster

Steps to access the POD from outside the cluster

In this blog, we will show you the Steps to access the POD from outside the cluster in Google Kubernetes environment.

 

REQUIREMENTS

  • 2 Node Cluster ( 1 Master VM with 2 Nodes)
  • Kubernetes Components

 

INFRASTRUCTURE OVERVIEW

  • We have already installed and configured the 2 Node cluster in our demo environment.

 

KUBERNETES SERVICES

  • We can able to access our application through services. Our application can be access from the inside and the outside the cluster.
  • Services will be the reliable between the POD and client end.
  • The service will get a virtual IP from the DNS and it will never change. Also, it gets a DNS name and a Port number. The port number is available through cluster-wide. Using this port we can able to access our application from outside.
  • We are creating endpoint object along with the services. It contains the POD information. The endpoint will get updated when a POD creates (or) deletes.
  • We tied pods with services using Labels.
  • We will specify the Labels information in the POD creation manifest file.
  • DNS cluster add-on implements DNS service in the cluster.
  • Services get DNS names that are resolvable inside the cluster.

 

ENVIRONMENT OVERVIEW

  • We have already created a POD named hello-pod for this demo.

Steps to access the POD from outside the cluster

 

  • Also, we used the below manifest file to create our demo hello-pod.

Steps to access the POD from outside the cluster

 

Note: Labels are mandatory for kubernetes services. So we need to specify the label information in the manifest file for POD creation.

 

  • Currently, there are 2 nodes in the cluster. Node 1 IP is 192.168.3.82 and Node 2 IP is 192.168.3.83

Steps to access the POD from outside the cluster

 

 

CREATING A SERVICE

  • From the Kubernetes Master server, execute the below command to create a service.

Syntax: kubectl expose pod <pod-name> --name=<name for the service> --port=<container application port> --type=NodePort

Example: kubectl expose pod hello-pod --name=hello-svc --port=80 --type=NodePort

Steps to access the POD from outside the cluster

 

Note: By default, public ngnix container listens to port 80.

 

  • Service created successfully.

Steps to access the POD from outside the cluster

 

  • Describe the service using the below command.

kubectl describe service hello-svc

Steps to access the POD from outside the cluster

 

  • The service virtual IP is 10.103.224.243 and the NodePort is 30134. Using this node port we can able to access the application from your local machine.
  • Services Port will be available from 30000 to 32767.

 

VERIFICATION

  • Open the web browser from the local machine and access type the kubernetes node IP along with the Node port.

Steps to access the POD from outside the cluster

 

  • We are able to access the nginx homepage successfully. It’s a containerized web server listening in the port 80 and we mapped it to 30134 in every node in the cluster.

Steps to access the POD from outside the cluster

 

  • We can also able to access the application from Node 2.

Steps to access the POD from outside the cluster

 

VIDEO

Thanks for reading this blog. We hope it was useful for you to learn to access the POD from outside the cluster.

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn
More Interested Related Posts
zfs pool usage
ZFS Pool and Dataset Usage

I am back with another blog to provide the useful script to the Freebsd users to determine the zpool and it’s datasets usage report. This

DirectAdmin Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk
$ 99 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • NDA & SLA
  • SLA Review Meetings
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation
  •  

Platinum Support

24/7 Proactive Support
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Support

$ 30 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response Time
  • 4 Hours Resolution time for the Possible Issues
  • Security and Performance Optimization
  • React to Customers queries
  • Simple SignUp Process
  • Instant Account Activation
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support

Cpanel Server Management Plans

Premium Support

24/7 End User Support from your Helpdesk

$ 99 Monthly / Server
  • 24/7 End User White Label Support
  • Unlimited Number of Tickets
  • Chat Support for Admin
  • Separate Account Manager
  • Guaranteed SLA
  • Weekly Status Reports
  • FREE Consultancy Services
  • Simple SignUp Process
  • Instant Account Activation

Platinum Support

24/7 Proactive Server Management
$ 49 Monthly / Server
  • Unlimited Support Plan
  • 24/7 Emergency Phone
  • Chat Support for Admin
  • Separate Account Manager
  • Advance Proactive Monitoring
  • Guaranteed SLA
  • SLA Review Meetings
  • 3rd Party Application Support
  • FREE Consultancy Services
  • Server Migration Support
  • Weekly Status Report
  • No End User Support
Popular

Unlimited Support

24/7 Server Management

$ 29 Monthly / Server
  • Unlimited Admin Tasks
  • 24/7 Support
  • Basic Monitoring
  • 30 Minutes Response time
  • 4 hours Response time for possible issues
  • Security and Performance Optimization
  • React to Customers queries
  • No Third party application support
  • No Migration and End User Support