Difference between revisions of "Kubectl port-forward"

From wikieduonline
Jump to navigation Jump to search
Line 1: Line 1:
 
{{lowercase}}
 
{{lowercase}}
 +
<code>[[kubectl]] [[port-forward]]</code>
 
* Man: https://www.mankier.com/1/kubectl-port-forward
 
* Man: https://www.mankier.com/1/kubectl-port-forward
  
* <code>[[kubectl]] [[port-forward]]</code>
 
 
* <code>kubectl --namespace default port-forward $POD_NAME 3000</code>
 
* <code>kubectl --namespace default port-forward $POD_NAME 3000</code>
 
* <code>kubectl port-forward [[svc]]/[[argocd]]-server -n argocd 8080:443</code>
 
* <code>kubectl port-forward [[svc]]/[[argocd]]-server -n argocd 8080:443</code>

Revision as of 17:40, 27 May 2022

kubectl port-forward

  • kubectl --namespace default port-forward $POD_NAME 3000
  • kubectl port-forward svc/argocd-server -n argocd 8080:443
export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=grafana,app.kubernetes.io/instance=grafana" -o jsonpath="{.items[0].metadata.name}")


kubectl --namespace default port-forward $POD_NAME 3000
error: unable to forward port because pod is not running. Current status=Failed
kubectl --namespace default port-forward $POD_NAME 3000
error: unable to forward port because pod is not running. Current status=Pending
kubectl --namespace default port-forward $POD_NAME 3000
Forwarding from 127.0.0.1:3000 -> 3000
Forwarding from [::1]:3000 -> 3000
kubectl --namespace default port-forward $POD_NAME 3000
error: You must be logged in to the server (Unauthorized)
kubectl --namespace default port-forward $POD_NAME 3000
error: TYPE/NAME and list of ports are required for port-forward
See 'kubectl port-forward -h' for help and examples


Related

See also

Advertising: