GithubHelp home page GithubHelp logo

Drain feature about keel HOT 8 CLOSED

keel-hq avatar keel-hq commented on July 24, 2024
Drain feature

from keel.

Comments (8)

rusenask avatar rusenask commented on July 24, 2024

Hi,

Interesting, have you checked how k8s stops containers during rolling update? I assumed it's graceful shutdown but it probably has a limit of 10 seconds and after that it just kills it.

I was planning to add two internal hooks:

  1. pre-update - this hook could probably do what you want. The idea is that it could call out to a remote service and inform it or wait (block) for response.
  2. post-update - inform remote service about update.

These hooks could either be inside the codebase (blocking and nonblocking webhooks) or custom code snippets (probably phase 2).

The problem here is that it quickly grows and soon it will require some kind of management interface & UI.

If pre/post update hooks makes sense for you, I will put up a roadmap this evening.

from keel.

sabrehagen avatar sabrehagen commented on July 24, 2024

Pre and post would solve this problem and others, so go with them. What would the hook notification mechanism be?

from keel.

rusenask avatar rusenask commented on July 24, 2024

Not sure yet, initially I thought it would be like a customizable list of endpoints to call for these webhooks and either wait, stop or proceed based on responses.

From your use-case it looks like the endpoint would be a service pointing to a deployment which will be undergoing an update. Are you running one container (replica) per deployment?

How do you think it should be configurable? Maybe each deployment could have label something like:
keel.sh/preupdateHooks=http://whatever.com/update
Problem here is that the value is limited to 63 characters.

Other option is to make these hooks configurable through the API and make a use of k8s label selectors:
selector: environment in (production, qa) endpoints: http://yourServiceName/shouldUpdate

Disadvantages of the option 2 is that Keel would become stateful :)

from keel.

sabrehagen avatar sabrehagen commented on July 24, 2024

Definitely want to keep it stateless. HTTP endpoints as you suggested are the way to go. They should just be an HTTP POST with metadata about the operation.

Have to overcome the 63 chars situation though. Maybe use an annotation?

from keel.

rusenask avatar rusenask commented on July 24, 2024

Excellent, annotations look exactly what we need here!

from keel.

sabrehagen avatar sabrehagen commented on July 24, 2024

This can be implemented using the new webhooks feature.

from keel.

rusenask avatar rusenask commented on July 24, 2024

Hey, webhooks weren't going to work for you as they were intended as "notifications" after the fact and the actual drain feature was planned to be added through plugins. I have created another notification, webhook:

{
	"name": "update deployment",
	"message": "message here",
	"createdAt": "2017-07-11T09:12:56.476274094+01:00",
	"type": "preparing deployment update",
	"level": "LevelDebug"
}

You can block now on that LevelDebug one and ignore others.

Slack :

screen shot 2017-07-11 at 09 09 28

Hope that helps!

from keel.

rusenask avatar rusenask commented on July 24, 2024

Closing this due to age, if advanced implementation of this required, please reopen or create a new one.

from keel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.