Interact with your pods
This details various ways that you can interact with the code and data running inside your pod.
Access a Pod via Network
If you want access to a specific pod, even if it’s not serving traffic on the internet. To achieve this, Kubernetes has support built into it.
kubectl port-forward <pod-name> <localport>:<podport>
kubectl port-forward istio 5015:80
A secure tunnel is created from your local machine, though the K8s master, to the instance of the Pod running on one of the worker nodes.
Getting More Info with Logs
When you need to debug.
# downloads the current logs from the running instance
kubectl logs kuard
# continuously streams logs
kubectl logs -f kuard
# get logs from a previous instance of the container. Useful if your containers are continuously restarting at startup.
kubectl logs kuard --previous
-c
if you have multiple containers in your Pod, you can choose the one to view