Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Services - Volumes associated with services donot get deleted when using acorn rm -af to delete the app using the service. #1583

Open
sangee2004 opened this issue May 8, 2023 · 4 comments
Labels
kind/bug Something isn't working
Milestone

Comments

@sangee2004
Copy link
Contributor

Acorn version - ### acorn version v0.7.0-alpha1-39-g696e7f52+696e7f52

Steps to reproduce the problem:
Deploy app that uses a service.
In my case, service creates volume and secret.
Deplete the app.

acorn apps
NAME          IMAGE          HEALTHY   UP-TO-DATE   CREATED   ENDPOINTS                                                MESSAGE
mytest        99aca2339227   1         1            11m ago   http://app-mytest-9c158bdf.local.on-acorn.io => app:80   [defined: waiting on missing secrets [mydb]]
mytest.mydb   1a061021afe6   1         1            11m ago   tcp://192.168.1.201:3306 => dbcon:3306                   OK

 % acorn secrets 
NAME                TYPE      KEYS                  CREATED
mytest.mydb.admin   basic     [password username]   11m ago

% acorn volumes
NAME                 APP-NAME             BOUND-VOLUME   CAPACITY   VOLUME-CLASS   STATUS    ACCESS-MODES   CREATED
mytest.mydb.mydata   mytest.mydb.mydata   mydata         15G        local-path     bound     RWO            11m ago
sangeethahariharan@Sangeethas-MacBook-Pro serviceexample % acorn rm -af mytest
Waiting for app mytest to be removed...
Removed: mytest
  •  No volumes associated with mytest
Removed: mytest.mydb.admin

 % acorn apps
NAME      IMAGE     HEALTHY   UP-TO-DATE   CREATED   ENDPOINTS   MESSAGE

 % acorn secrets
NAME      TYPE      KEYS      CREATED
 % acorn volumes
NAME                 APP-NAME             BOUND-VOLUME   CAPACITY   VOLUME-CLASS   STATUS     ACCESS-MODES   CREATED
mytest.mydb.mydata   mytest.mydb.mydata   mydata         15G        local-path     released   RWO            11m ago

App relating to the service gets deleted.
Secrets associated with service also gets deleted as expected .
Volume continues to be present in the "released" state and never gets removed.

@sangee2004 sangee2004 added the kind/bug Something isn't working label May 8, 2023
@sangee2004 sangee2004 added this to the v0.7.0 milestone May 8, 2023
@sangee2004 sangee2004 changed the title Volumes associated with services donot get deleted when using acorn rm -af to delete the app using the service. Services - Volumes associated with services donot get deleted when using acorn rm -af to delete the app using the service. May 9, 2023
@cjellick
Copy link
Member

Can we confirm that when you do acorn rm -af foo, child services such as foo.db also get deleted?
If it does, then yes, volume and secrets for foo.db should aslo get deleted.

@cjellick cjellick modified the milestones: v0.7.0, v0.8.0 May 31, 2023
@cjellick cjellick modified the milestones: v0.8.0, Backlog Aug 25, 2023
@cjellick
Copy link
Member

This is old enough to warrant a retest or if you already know without testing, just let me know if you think this is still a problem

@cjellick cjellick modified the milestones: Backlog, v0.8.0 Aug 25, 2023
@sangee2004
Copy link
Contributor Author

sangee2004 commented Aug 25, 2023

Tested with acorn version - v0.8.0-rc4-58-gbe49d0bd+be49d0bd
I am still able to see the volumes not being cleaned up when the consuming app gets deleted.

  1. Deploy the an app that consumes a service (that has volume defined in it).
    App fails to come up successfully waiting for the service (this most probably because of something not right with the service)
acorn apps
NAME          IMAGE                                  COMMIT    CREATED    ENDPOINTS                                       MESSAGE
mytest        3e2bf5ac815f                                     71s ago    http://app-mytest-9c158bdf.local.oss-acorn.io   (container: app): waiting for service to be created [mydb]; (service: mydb): not ready
mytest.mydb   docker.io/sangeetha/mytestsql:v0.0.1             71s ago    tcp://<ip>:3306                        OK
  1. Delete the app using acorn rm -af mytest

Child service - mytest.mydb gets cleaned up but leaves behind volume in "released" state.s
Secrets associated with the service gets removed as expected.

 % acorn apps
NAME      IMAGE     COMMIT    CREATED   ENDPOINTS   MESSAGE
 % acorn secrets
NAME      TYPE      KEYS      CREATED
% acorn volumes
NAME                 BOUND-VOLUME   CAPACITY   VOLUME-CLASS   STATUS     ACCESS-MODES   CREATED
mytest.mydb.mydata   mydata         15G        local-path     released   RWO            18m ago

@cjellick
Copy link
Member

Thanks for retesting

@cjellick cjellick modified the milestones: v0.8.0, Backlog Aug 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants