microsoft / mindaro

Bridge to Kubernetes - for Visual Studio and Visual Studio Code
MIT License
307 stars 106 forks source link

replicaset.apps is not getting removed on session disconnect #186

Closed hassanrazakhalid closed 3 years ago

hassanrazakhalid commented 3 years ago

Describe the bug When disconnecting a session. Resource replicaset.apps is not getting removed after session disconnect.

To Reproduce

  1. Configure Kubernetes bridge using the documentation. (bridge-to-kubernetes)
  2. Then disconnect the session
  3. Then run again and disconnect
  4. replicaset.apps will start to pile up.
**Expected behavior** replicaset.apps should be cleared on session disconnect. **Logs** replicaset.apps/identity-server-7655bc5845 0 0 0 52m replicaset.apps/identity-server-84db85f5f6 0 0 0 48m replicaset.apps/identity-server-56d4ff964b 0 0 0 47m replicaset.apps/identity-server-85c55ccdf 0 0 0 41m replicaset.apps/identity-server-868664bb59 1 1 1 62m replicaset.apps/identity-server-7c8c9958c6 0 0 0 38 **Environment Details** Client used (VS Code/Visual Studio): mindaro-dev.file-downloader@1.0.11 mindaro.mindaro@1.0.120210605 - VSCode 1.57 - Kubernetes exteion 1.3.3 - Bridge to Kubernetes v1.0.120210605 - Microk8s on ubuntu 18 - Kubernetes version 1.21 Operating System: BigSur-11.4
pragyamehta commented 3 years ago

Hi @hassanrazakhalid Thanks for reaching out to us! The replicaset you have mentioned - "identity-server" does not belong to our todo sample app that you have linked. However, depending on whichever service you debug with Bridge to Kubernetes, at a maximum 10 replicasets may be left behind. This is a feature of Kubernetes rolling update strategy and by default, for apps/v1 deployments, it keeps the last 10 replicasets behind for each change in the deployment object. We can reduce this number to a smaller number for our sample apps by setting the revisionHistoryLimit or by moving our sample app deployments to apps/v1beta1, if this is posing problems for you.

hassanrazakhalid commented 3 years ago

Yes you right. Changing revisionHistoryLimit to 0 leaves no resources of replicaset. This issue can be closed. Thank you