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

Re-using the same pods#

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

Contents


More Related Answers

  • kubectl delete pods matching pattern
  • Restart-pods command line tool

  • Re-using the same pods#

    0

    In addition to the kubectl create command we executed previously, we’ll also add the --save-config argument. It’ll save the configuration of the ReplicaSet thus allowing us to perform a few additional operations later on. We’ll get to them shortly. For now, the important thing is that we are about to create the same ReplicaSet we had before.

    12

    kubectl create -f go-demo-2.yml \

    --save-config

    Create 'go-demo-2' Replicaset while saving configurations

    The output states that the “replicaset go-demo-2” was created. Let’s see what happened with the Pods.

    1

    kubectl get pods

    Get the pods

    The output is as follows.

    123

    NAME READY STATUS RESTARTS AGE

    go-demo-2-md5xp 2/2 Running 0 10m

    go-demo-2-vnmf7 2/2 Running 0 10m

    Output of the above command

    If you compare the names of the Pods, you’ll see that they are the same as before we created the ReplicaSet. It looked for matching labels, deduced that there are two Pods that match them, and decided that there’s no need to create new ones. The matching Pods fulfill the desired number of replicas.

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

    Closely Related Answers



    0

    In addition to the kubectl create command we executed previously, we’ll also add the --save-config argument. It’ll save the configuration of the ReplicaSet thus allowing us to perform a few additional operations later on. We’ll get to them shortly. For now, the important thing is that we are about to create the same ReplicaSet we had before.

    12

    kubectl create -f go-demo-2.yml \

    --save-config

    Create 'go-demo-2' Replicaset while saving configurations

    The output states that the “replicaset go-demo-2” was created. Let’s see what happened with the Pods.

    kubectl get pods

    Get the pods

    The output is as follows.

    NAME READY STATUS RESTARTS AGE

    go-demo-2-md5xp 2/2 Running 0 10m

    go-demo-2-vnmf7 2/2 Running 0 10m

    Output of the above command

    If you compare the names of the Pods, you’ll see that they are the same as before we created the ReplicaSet. It looked for matching labels, deduced that there are two Pods that match them, and decided that there’s no need to create new ones. The matching Pods fulfill the desired number of replicas.

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

    0

    In addition to the kubectl create command we executed previously, we’ll also add the --save-config argument. It’ll save the configuration of the ReplicaSet thus allowing us to perform a few additional operations later on. We’ll get to them shortly. For now, the important thing is that we are about to create the same ReplicaSet we had before.

    12

    kubectl create -f go-demo-2.yml \

    --save-config

    Create 'go-demo-2' Replicaset while saving configurations

    The output states that the “replicaset go-demo-2” was created. Let’s see what happened with the Pods.

    1

    kubectl get pods

    Get the pods

    The output is as follows.

    123

    NAME READY STATUS RESTARTS AGE

    go-demo-2-md5xp 2/2 Running 0 10m

    go-demo-2-vnmf7 2/2 Running 0 10m

    Output of the above command

    If you compare the names of the Pods, you’ll see that they are the same as before we created the ReplicaSet. It looked for matching labels, deduced that there are two Pods that match them, and decided that there’s no need to create new ones. The matching Pods fulfill the desired number of replicas.

    Popularity 1/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Tags: whatever
    Link to this answer
    Share Copy Link
    Contributed on Jun 20 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.