Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Playing with Running Pods

Sumit Rawal answered on June 17, 2023 Popularity 1/10 Helpfulness 1/10

Contents


More Related Answers

  • Creating Pods
  • Getting Started with Pods

  • Playing with Running Pods

    0

    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: nohup is a POSIX command which means no hang up. It will make sure that port-forward is running in the background like a service, and it will also enable us to further write commands in the same terminal without having to open a new one. The above command would now become: 

    Popularity 1/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Jun 17 2023
    Sumit Rawal
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.