Editing Kubectl port-forward
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
+ | {{Draft}} | ||
{{lowercase}} | {{lowercase}} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | * <code>[[kubectl]] [[port-forward]]</code> | |
− | * | + | * <code>kubectl --namespace default port-forward $POD_NAME 3000</code> |
− | |||
− | |||
− | |||
− | |||
− | + | 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 | kubectl --namespace default port-forward $POD_NAME 3000 | ||
Forwarding from 127.0.0.1:3000 -> 3000 | Forwarding from 127.0.0.1:3000 -> 3000 | ||
Forwarding from [::1]:3000 -> 3000 | Forwarding from [::1]:3000 -> 3000 | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
kubectl --namespace default port-forward $POD_NAME 3000 | kubectl --namespace default port-forward $POD_NAME 3000 | ||
error: You must be logged in to the server ([[Unauthorized]]) | error: You must be logged in to the server ([[Unauthorized]]) | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Related == | == Related == | ||
* <code>[[kubectl get pods]]</code> | * <code>[[kubectl get pods]]</code> | ||
* [[Port forwarding]] | * [[Port forwarding]] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
== See also == | == See also == | ||
− | * {{kubectl | + | * {{kubectl}} |
− | |||
− | |||
[[Category:Kubernetes]] | [[Category:Kubernetes]] |
Advertising: