Kopf —Kubernetes Operator Pythonic Framework— is a framework and a library to make Kubernetes operator's development easier, just in a few lines of Python code. The main goal is to bring the Domain-Driven Design to the infrastructure level, with Kubernetes being an orchestrator/database of the domain objects (custom resources), and the operators containing the domain logic (with no or minimal infrastructure logic). The project was originally started as zalando-incubator/kopf in March 2019, and then forked as nolar/kopf in August 2020: but it is the same codebase, the same packages, the same developer(s). A full-featured operator in just 2 files: a Dockerfile + a Python file (*). Handling functions registered via decorators with a declarative approach. No infrastructure boilerplate code with K8s API communication. Both sync and async handlers, with sync ones being threaded under the hood. Detailed documentation with examples.
Features
- Simple, but powerful
- Intuitive mapping of Python concepts to Kubernetes concepts and back
- Support anything that exists in K8s
- All the ways of handling all that a developer can wish for
- Eventual consistency of handling
- Awareness of other Kopf-based operators