Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"skaffold delete --wait" #770

Closed
ahmetb opened this issue Jun 29, 2018 · 5 comments
Closed

"skaffold delete --wait" #770

ahmetb opened this issue Jun 29, 2018 · 5 comments

Comments

@ahmetb
Copy link
Contributor

ahmetb commented Jun 29, 2018

skaffold v0.8.0

If I do a skaffold delete immediately followed by a skaffold dev, I see this output, which is unexpected (note the "configured" words):

Build complete in 5.850115221s
Starting deploy...
deployment.extensions/cartservice created
service/cartservice created
deployment.extensions/checkoutservice created
service/checkoutservice created
deployment.extensions/currencyservice configured
service/currencyservice created
deployment.extensions/emailservice configured
service/emailservice created
deployment.extensions/frontend configured
service/frontend created
service/frontend-external created
deployment.extensions/paymentservice configured
service/paymentservice created
deployment.extensions/productcatalogservice configured
service/productcatalogservice created
deployment.extensions/recommendationservice configured
service/recommendationservice created
deployment.extensions/redis-cart created
service/redis-cart created
deployment.extensions/shippingservice configured
service/shippingservice created
Deploy complete in 1.505724832s
Watching for changes...

If I just did a skaffold delete I expect these resources to be deleted.

What ended up happening is that skaffold delete kicks off deletes but doesn't actually wait until deletions are complete. As a result, skaffold dev now has created these deployments:

kubectl get deployment
NAME              DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
cartservice       1         1         1            1           3m
checkoutservice   1         1         1            1           3m
redis-cart        1         1         1            1           3m

whereas if I actually run skaffold delete and wait for everything to actually get deleted, then run skaffold dev I get the full list of deployments as I expected:

kubectl get deployment
NAME                    DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
cartservice             1         1         1            1           23s
checkoutservice         1         1         1            1           23s
currencyservice         1         1         1            1           23s
emailservice            1         1         1            1           23s
frontend                1         1         1            0           23s
paymentservice          1         1         1            1           23s
productcatalogservice   1         1         1            1           23s
recommendationservice   1         1         1            1           23s
redis-cart              1         1         1            1           22s
shippingservice         1         1         1            1           22s
@r2d4
Copy link
Contributor

r2d4 commented Jun 29, 2018

This race condition actually gets worse when we set the grace-period to be lower. We could do a skaffold delete --wait, #176

@ahmetb
Copy link
Contributor Author

ahmetb commented Jun 29, 2018

Argh I assumed --grace-period would do a forced kill much faster. We can roll that back.

@r2d4
Copy link
Contributor

r2d4 commented Jun 29, 2018

We might be able to tackle it from the apply side and make sure that we're aren't trying to apply anything thats already in a Terminating state. Thats kind of unintuitive behavior from kubectl anyways.

@dgageot dgageot added cmd/dev and removed cmd/dev labels Jan 21, 2019
@dgageot dgageot added area/dev and removed cmd/dev labels Jul 11, 2019
@balopat balopat added priority/p1 High impact feature/bug. area/ci-cd labels Sep 4, 2019
@balopat balopat changed the title race condition with kubernetes resources "skaffold delete" followed by "skaffold dev" "skaffold delete --wait" Sep 4, 2019
@balopat
Copy link
Contributor

balopat commented Sep 4, 2019

I think this could be interesting for CI/CD use cases. @tejal29 what do you think?

@tstromberg
Copy link
Contributor

Thank you for the idea!

I'm closing this issue as it's been open a while, and no one has yet stated an interest in addressing it. If you feels strongly about this issue, feel free to comment here or re-raise an issue referencing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants