Playing with Running Pods
Learn different ways to interact with pods.
We'll cover the following...
After we have a pod running, we can interact with it in a few different ways. Let’s see a few examples.
First, let’s run the pod from our previous example by using the following command:
kubectl apply -f nginx.yaml
To access the application locally, you need to run:
kubectl port-forward nginx 3001:80
Note: Please wait for the pods to be in a running state before executing the port-forward command.
But to access the application on this platform, you need to add an additional address flag. After running the port-forward command, in order to run further commands, we can open a new terminal, or we can run the port-forward
command with nohup
.
kubectl port-forward --address 0.0.0.0 nginx 3001:80
Note: ...
Access this course and 1400+ top-rated courses and projects.