Sometimes we may need to connect to a Kubernetes pod to perform simple tasks like executing simple commands, checking
connectivity from pod to other networks, for such activities the below debug command really helps Developer who does
not have much knowledge about Kubernetes
Sometimes we might save file in Kubernetes secrets e.g. client certificate, ssh keys, any encrypted files
We might need such files sometimes in our local machine for debugging or local development
These files might not be copied directly or downloadable directly from Kubernetes UI. In this case, the below command
really helps to download as it is.
kubectl--cluster=<clustername>-n<namespace>getsecrets"<name of the entry>"-ojson|jq-r'.data."<key>"'|base64-d><desiredtargetfilenamee.g.localhost.p12>
```## Port Forwarding-SometimeswemightneedtodebugapodonKubernetesforexampletestingconfigurations.
-SometimesourlocalapplicationmightwanttoconnecttoparticularKubernetespod,inthese
cases[PortForwarding](https://kubernetes.io/docs/reference/kubectl/generated/kubectl_port-forward/)reallyhelpful.
```shell
kubectlgetpods-n<namespace>--cluster=<clustername>
kubectl--cluster=<clustername>-n<namespace>port-forward<intendedpod><localport1>:<remoteport1>...<localportn>:<remoteportn>