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.
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.
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.