minReadySeconds on line 10 instructs Kubernetes to wait for 20 seconds after updating each replica. Hence, Kubernetes will update the first replica, wait 20 seconds, update the second replica, wait 20 seconds, update the third, and so on.
Waiting like this gives you a chance to run tests and make sure that the new replicas are working as expected. In the real world, you’ll probably have to wait longer than 20 seconds.
Also, Kubernetes is not actually updating replicas. It’s deleting the existing replica and replacing it with a new one running on the new version.
Lines 11 and 12 force Kubernetes to perform all updates to this Deployment as rolling updates.
Lines 14 and 15 force Kubernetes to update one Pod at a time. It works like this:
Line 14 allows Kubernetes to add one extra Pod during an update operation. If you have 5 Pods, Kubernetes will increase that to 6 Pods during the update. Line 15 prevents Kubernetes from reducing the number of Pods during an update. If you have requested 5 Pods, Kubernetes will not be allowed to go lower than this number. When combined, lines 14 and 15 force Kubernetes to update (replace) one Pod at a time.
In the next lesson, you will apply and review these changes.