Every time a deployment gets updated, a new replica set is added to a long list. Should the old rs be cleaned?
Deployment is an object which can own ReplicaSets and update them and their Pods via declarative, server-side rolling updates. While ReplicaSets can be used independently, today they're mainly used by Deployments as a mechanism to orchestrate Pod creation, deletion and updates.
Try to update your ReplicaSet through the command kubectl edit rs $REPLICASET_NAME ; you will access this resource via the default editor with a YAML configuration file: // demonstrate to change the number of Pod replicas.
The replica sets can be multiple up to a limit of 10 based on the number of updates that have been done using deployment. But only one replicaSet (the latest one) should be showing the number of pods; all other older sets should be showing 0 .
Removing old replicasets is part of the Deployment object, but it is optional. You can set .spec.revisionHistoryLimit
to tell the Deployment how many old replicasets to keep around.
Here is a YAML example:
apiVersion: apps/v1 kind: Deployment # ... spec: # ... revisionHistoryLimit: 0 # Default to 10 if not specified # ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With