What is the output when you run kubectl port-forward pod/myapp-pod 8080:80 successfully?
kubectl port-forward pod/myapp-pod 8080:80
Successful port-forward shows the local and IPv6 forwarding lines.
When port-forward works, kubectl shows forwarding lines for localhost and IPv6 addresses.
What is the main purpose of using kubectl port-forward in Kubernetes?
Think about temporary local access to pod ports.
kubectl port-forward lets you access pod ports locally without exposing them externally or changing cluster resources.
You run kubectl port-forward pod/myapp-pod 8080:80 but get error: unable to forward port because connection refused. What is the most likely cause?
Check pod status and container ports.
Connection refused usually means the pod is not running or the target port inside the pod is not open.
You want to access port 5432 of a PostgreSQL service named db-service locally on port 15432. Which command is correct?
Remember to specify the resource type and correct port mapping.
To port-forward a service, use kubectl port-forward svc/servicename localPort:servicePort.
Which practice helps keep your local system secure when using kubectl port-forward?
Think about limiting network exposure.
Port-forward binds to localhost by default, which is safer. Avoid exposing forwarded ports to public networks to reduce risk.