|
1 |
| -## d-operators |
| 1 | +## D-operators |
2 | 2 | D-operators define various declarative patterns to write kubernetes controllers. This uses [metac](https://github.com/AmitKumarDas/metac/) under the hood. Users can _create_, _delete_, _update_, _assert_, _patch_, _clone_, & _schedule_ one or more kubernetes resources _(native as well as custom)_ using a yaml file. D-operators expose a bunch of kubernetes custom resources that provide the building blocks to implement a higher order controller.
|
3 | 3 |
|
4 | 4 | D-operators follow a pure intent based approach to writing specifications **instead of** having to deal with yamls that are cluttered with scripts, kubectl, loops, conditions, templating and so on.
|
5 | 5 |
|
6 | 6 | ### Programmatic vs. Declarative
|
7 |
| -It is important to understand that these declarative patterns are built upon programmatic ones. The low level constructs _(read native k8s resources & custom resources)_ might be implemented in programming language(s) of one's choice. Use d-controller's YAMLs to aggregate these low level resources in a particular way to build a completely new kubernetes controller. |
| 7 | +It is important to understand that these declarative patterns are built upon programmatic ones. The low level constructs _(read native Kubernetes resources & custom resources)_ might be implemented in programming language(s) of one's choice. Use d-controller's YAMLs to aggregate these low level resources in a particular way to build a completely new kubernetes controller. |
8 | 8 |
|
9 |
| -### When to use d-operators |
10 |
| -D-operators is not meant to build complex controllers like Deployment, StatefulSet or Pod in a declarative yaml. However, if one needs to use Deployment, StatefulSet, Pod, etc. to build new k8s controller(s) then d-operators' declarative constructs _(read custom resources)_ should be considered to build one. |
| 9 | +### When to use D-operators |
| 10 | +D-operators is not meant to build complex controller logic like Deployment, StatefulSet or Pod in a declarative yaml. However, if one needs to use available Kubernetes resources to build new k8s controller(s) then d-operators should be considered to build one. D-operators helps implement the last mile automation needed to manage applications & infrastructure in Kubernetes clusters. |
11 | 11 |
|
12 |
| -However, any controller which is complex and at the same time is **generic** enough to be used along with other kubernetes resources, can be implemented as a core d-operator custom resource. |
| 12 | +### E to E testing |
| 13 | +D-operators make use of d-operators _(i.e. its own self)_ to test its controllers. It does not need kubectl, bash, sed, awk etc to test its controllers. In addition, it does not depend on writing go code to write tests. It makes use of declarative YAMLs to test its controllers. |
13 | 14 |
|
14 |
| -### Available controllers |
| 15 | +_NOTE: One can make use of these YAMLs (kind: Recipe) to test any Kubernetes controllers declaratively_ |
| 16 | + |
| 17 | +Navigate to test/experiments to learn more on these YAMLs. |
| 18 | + |
| 19 | +```sh |
| 20 | +# Following runs the e2e test suite |
| 21 | +# |
| 22 | +# NOTE: test/e2e/suite.sh does the following: |
| 23 | +# - d-operators' image known as 'dope' is built |
| 24 | +# - a docker container is started & acts as the image registry |
| 25 | +# - dope image is pushed to this image registry |
| 26 | +# - k3s is installed with above image registry |
| 27 | +# - d-operators' manifests are applied |
| 28 | +# - experiments _(i.e. test code written as YAMLs)_ are applied |
| 29 | +# - experiments are asserted |
| 30 | +# - if all experiments pass then e2e is a success else it failed |
| 31 | +# - k3s is un-installed |
| 32 | +# - local image registry is stopped |
| 33 | +sudo make e2e-test |
| 34 | +``` |
| 35 | + |
| 36 | +### Available Kubernetes controllers |
15 | 37 | - [x] kind: Recipe
|
16 | 38 | - [ ] kind: HTTP
|
17 |
| -- [ ] kind: Chef |
| 39 | +- [ ] kind: HTTPPipe |
18 | 40 | - [ ] kind: Command
|
19 | 41 | - [ ] kind: DaemonJob
|
20 |
| -- [ ] kind: MasterChef |
| 42 | +- [ ] kind: UberLoop |
0 commit comments