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 2: Line 2:
 
<code>[[kubectl]] [[port-forward]]</code> [[forward]] one or more local ports to a [[pod]].
 
<code>[[kubectl]] [[port-forward]]</code> [[forward]] one or more local ports to a [[pod]].
 
* Man: https://www.mankier.com/1/kubectl-port-forward
 
* Man: https://www.mankier.com/1/kubectl-port-forward
* <code>[[kubectl port-forward --help]]</code>
 
* <code>[[kubectl]] [[port-forward]] [[deployment/]]mydeployment 8080:443</code>
 
* <code>[[kubectl]] [[port-forward]] [[deployment/]]mydeployment 8080:443 &</code>
 
  
 
== Examples ==
 
== Examples ==
* [[Grafana]]: <code>kubectl --namespace default port-forward [[$POD_NAME]] [[3000]]</code>
+
* <code>kubectl --namespace default port-forward $POD_NAME 3000</code>
* [[Prometheus]]:
+
* <code>kubectl port-forward [[svc]]/[[argocd]]-server -n argocd 8080:443</code>
** <code>kubectl --namespace default port-forward $POD_NAME [[9090]]</code>
 
** <code>[[kubectl port-forward]] --namespace default [[svc/]][[prometheus-kube-prometheus-prometheus]] [[9090]]:9090</code>
 
** [[Alertmanager]]: <code>kubectl port-forward --namespace default svc/prometheus-kube-prometheus-alertmanager 9093:9093</code>
 
 
 
<code>[[kubectl port-forward svc/argocd-server -n argocd 8080:443]]</code>
 
[[Forwarding from]] 127.0.0.1:8080 -> 8080
 
  
 
  [[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}")
 
  [[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}")
Line 25: Line 16:
 
  Forwarding from 127.0.0.1:8443 -> 8443
 
  Forwarding from 127.0.0.1:8443 -> 8443
 
  Forwarding from [::1]:8443 -> 8443
 
  Forwarding from [::1]:8443 -> 8443
 
kubectl -n your-namespace port-forward [[service]]/[[pritunl-ui]] 7111:443
 
 
  
  
Line 38: Line 26:
  
 
  kubectl --namespace default port-forward $POD_NAME 3000
 
  kubectl --namespace default port-forward $POD_NAME 3000
  [[error: unable to forward port because pod is not running. Current status=Pending]]
+
  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
Line 46: Line 34:
 
  error: TYPE/NAME and list of ports are required for port-forward
 
  error: TYPE/NAME and list of ports are required for port-forward
 
  See '[[kubectl port-forward -h]]' for help and examples
 
  See '[[kubectl port-forward -h]]' for help and examples
 
kubectl port-forward service/my-argo-argocd-server -n default 8080:443
 
[[error: timed out waiting for the condition]]
 
 
 
[[bind: address alredy in use]] [[unable to create listener]]
 
 
Solution: <code>[[lsof -i]]</code>
 
  
 
== Related ==
 
== Related ==
Line 60: Line 40:
 
* <code>[[kubectl proxy]]</code>
 
* <code>[[kubectl proxy]]</code>
 
* [[Kubernetes networking]]
 
* [[Kubernetes networking]]
* <code>[[kubectl get services]]</code>
 
* [[kubectl create service clusterip]]
 
* [[minikube tunnel]]
 
  
 
== See also ==
 
== See also ==

Please note that all contributions to wikieduonline may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wikieduonline:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Advertising: