Promise Theory & it’s relevance in Kubernetes!
A traditional approach for managing an IT system is through Obligation model i.e. a command & control model in which an agent issues a list of instructions to all the parts involved to carry out some kind of an “algorithm”.
The fundamental problem with obligation model approach is that it separates “intent” from its “implementation”. Further expanding on this — What it essentially means is that the place where the instructions are determined is not the place where they must be carried out, so the agent does not have the information about conditions where the local work needs to take place. Such a situation is highly undesirable because of the unpredictability it ends up creating about the outcome!
In contrast, in the Promise based model, each part behaves only according to the promises it makes to others. Instead of instructions, we have behaviour promised from within. Since the promises are made by “self” and not by an external agent, it means that the decision is always made with knowledge of the same circumstances under which implementation will take place; hence resulting in a more predictable outcome!
Promise Theory was proposed by Mark Burgess in 2004, in the context of computer science, in order to solve problems present in obligation-based computer management schemes for policy-based management.
Promise Theory, in the context of information science, is a model of voluntary cooperation between individual, autonomous actors or agents who publish their intentions to one another in the form of promises.
A ‘promise’ is a declaration of intent whose purpose is to increase the recipient’s certainty about a claim of past, present or future behaviour.
For a promise to increase certainty, the recipient needs to trust the promiser, but trust can also be built on the verification (or ‘assessment’) that previous promises have been kept, thus trust plays a symbiotic relationship with promises. Each agent assesses its belief in the promise’s outcome or intent.
Relevance in Kubernetes
I’ll explain this through an excellent analogy by Kelsey Hightower in one of his talk.
Let’s say — the holidays are coming up and you want to ship something to a loved one as a present. So, let’s invent the post office!
The post office says — We can ship things, but we don’t want you to bring loose things to us. We don’t want loose books and jewellery and money. You need to put your present in a box. Now there’s going to be a cost for you to move this present box from one place to another. Now, whatever you put inside of it is up to you.
If you think about it, the post office abstracts all that away from you. You show up with your present box, your stamp and the address, and they will tell you in how long it will get delivered to that address!
In the computer world, these present boxes are the containers that can support any programming language — Ruby, Python, Java, Golang, it really doesn’t matter! To make Kubernetes as efficient as the post office, we need to ask you to put it in the box. Now, the key is you now have to describe where it needs to go. We need to put an address on it. Where does it run, who’s it destined for and how long would you like to take or are willing to wait for it to get there?
Planes can breakdown, cars can breakdown, but no one at the post office ever calls you when any of those things happen! They make a promise to you — They promise that this letter will get there in 2 days. How they do it is not a concern!
Kubernetes is built on exactly this notion of “Promise Theory” — Even though you have lots of machines in your Kubernetes cluster, any of them can break at any time, but Kubernetes job is to make sure that application is always running, just like the post office’s job is to make sure that letter keeps moving until it gets to its destination. Kubernetes does that for infrastructure.
Kubernetes abstract away all the details and allow developers to just put their app in a box, give an address, and if they can afford the postage, it will run it for them.
It’s a “promise” from Kubernetes to you!