kube-addon-updater.sh not working properly for Deployments #23471
Description
Current logic in kube-addon-updater.sh
is the following:
- Check object names in the yaml files on disk and compare with objects with
kubernetes.io/cluster-service=true
label - Delete objects not listed on disk which exist in the system
- Create not existing objects
- Delete&Create objects for which are using name suffixes to find next version (e.g.
heapster-1.0
andheapster-1.1
with-
used as a separator). This is currently done only forReplicationControllers
Recently @Q-Lee in #22893 added support for Deployments in this script and removed name suffixes for objects using Deployments (i.e. heapsteR). This has several problems:
a) Without name change we will never update Deployment object
b) Once we add reconciling ReplicaSet object in addon updater it will clash with Deployment controller - controller will create ReplicaSet, which will be delete by addon updater as it's not explicitly listed in yaml files
c) Even if we fix addon-updater to simply compare object spec (so that we don't have to rely on object name changes) we have addon-resizer, that will modify object spec (request/limit fields) that will show as a difference when comparing spec and addon-updater will override it
I believe we should not cherry-pick this PR to 1.2 and rethink the whole approach.
@Q-Lee (PR author)
@mikedanese (PR reviewer)
@zmerlynn (understands kube-addon-updater.sh)
@bgrant0607 (reviews PRs for cherrypick)
@roberthbailey (active in discussion about this feature)