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.

How to get port of a pod in Kubernetes?

To get the port of a pod in Kubernetes, you can use the kubectl command along with the get and describe options.

Here are the steps:

1. List all the pods in the cluster to find the specific pod you’re interested in:

kubectl get pods
Code language: JavaScript (javascript)

2. Identify the name of the pod from the list of pods.

3. Retrieve detailed information about the pod, including the container ports:

kubectl describe pod <pod-name>Code language: HTML, XML (xml)

4. Look for the “Containers” section in the output. Under each container, you will find the “Ports” field, which lists the container ports.

Alternatively, you can use the kubectl get command with the -o or --output flag to format the output and display only the port information for the pod:

kubectl get pod <pod-name> -o jsonpath='{.spec.containers[*].ports[*].containerPort}'Code language: JavaScript (javascript)

This command uses jsonpath to extract the container port(s) from the pod’s specification.

Replace <pod-name> with the name of the pod you want to get the port for.

By following these steps, you can retrieve the port(s) associated with a specific pod in Kubernetes.

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
MotoShare.in is your go-to platform for adventure and exploration. Rent premium bikes for epic journeys or simple scooters for your daily errands—all with the MotoShare.in advantage of affordability and ease.

Related Posts

List of containerized storage orchestration in Kubernetes

List of Containerized Storage Orchestration Solutions in Kubernetes (2026 Edition) Kubernetes has become excellent at orchestrating stateless applications, but stateful workloads still need a proper storage layer….

Read More

Understanding Authentication & Authorization in kubernetes

Authentication – How User’s access should be allowed? The process or action of verifying the identity of a user or process.Authorization – What Access and till what…

Read More

Kubernetes 1.23.6 Cluster Setup Master and Worker in Ubuntu 20.04

Latest doc – https://github.com/certifications-tutorials/kubernetes-cluster-setup Following commands would help you to create 1 Master and 1 Node in same VM. Run Following commands in Master Node Run following…

Read More

Kubernetes PersistentVolume, PersistentVolumeClaim, volume using hostPath

pv.yaml $ kubectl create -f pv.yaml $ kubectl get pv pvc.yaml $ kubectl create -f pvc.yaml $ kubectl get pvc pod.yaml Rajesh Kumar I’m a DevOps/SRE/DevSecOps/Cloud Expert…

Read More

Kubernetes: Working with ReplicationController

A ReplicationController is a Kubernetes controller that ensures that a specified number of pod replicas are running at any one time. In other words, a ReplicationController makes…

Read More

Kubernetes Tutorials: Pod Load balancing using Service

In Kubernetes, a Service is an abstraction that defines a logical set of pods and a policy by which to access them. It provides a stable network…

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