Bird
0
0

What is the main purpose of kubectl port-forward in Kubernetes?

easy📝 Conceptual Q11 of 15
Kubernetes - kubectl Essential Commands
What is the main purpose of kubectl port-forward in Kubernetes?
ATo connect your local machine to a pod or service port inside the cluster
BTo expose a pod to the internet permanently
CTo create a new Kubernetes service
DTo delete a pod from the cluster
Step-by-Step Solution
Solution:
  1. Step 1: Understand the function of port-forward

    kubectl port-forward creates a temporary tunnel from your local machine to a pod or service port inside the Kubernetes cluster.
  2. Step 2: Compare other options

    Exposing pods permanently or creating/deleting resources are different commands and purposes.
  3. Final Answer:

    To connect your local machine to a pod or service port inside the cluster -> Option A
  4. Quick Check:

    Port-forward = local to pod/service connection [OK]
Quick Trick: Port-forward = local access to pod/service port [OK]
Common Mistakes:
  • Thinking port-forward exposes pods publicly
  • Confusing port-forward with service creation
  • Assuming it deletes pods

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes