{"id":28530813,"url":"https://github.com/mayadata-io/d-operators","last_synced_at":"2025-07-07T08:32:28.653Z","repository":{"id":54451267,"uuid":"242175629","full_name":"mayadata-io/d-operators","owner":"mayadata-io","description":"Declarative patterns to write kubernetes controllers","archived":false,"fork":false,"pushed_at":"2021-02-17T05:29:57.000Z","size":8736,"stargazers_count":10,"open_issues_count":89,"forks_count":7,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-06-09T14:54:13.859Z","etag":null,"topics":["conformance","controller","declarative","e2e","kubernetes","metacontroller"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mayadata-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-21T15:53:10.000Z","updated_at":"2021-07-31T18:19:08.000Z","dependencies_parsed_at":"2022-08-13T16:10:10.425Z","dependency_job_id":null,"html_url":"https://github.com/mayadata-io/d-operators","commit_stats":null,"previous_names":[],"tags_count":48,"template":false,"template_full_name":null,"purl":"pkg:github/mayadata-io/d-operators","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayadata-io%2Fd-operators","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayadata-io%2Fd-operators/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayadata-io%2Fd-operators/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayadata-io%2Fd-operators/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mayadata-io","download_url":"https://codeload.github.com/mayadata-io/d-operators/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mayadata-io%2Fd-operators/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264043045,"owners_count":23548499,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["conformance","controller","declarative","e2e","kubernetes","metacontroller"],"created_at":"2025-06-09T14:37:35.507Z","updated_at":"2025-07-07T08:32:28.648Z","avatar_url":"https://github.com/mayadata-io.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## D-operators\nD-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_, \u0026 _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 higher order controller(s).\n\nD-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.\n\n### A sample declarative intent\n```yaml\napiVersion: dope.mayadata.io/v1\nkind: Recipe\nmetadata:\n  name: crud-ops-on-pod\n  namespace: d-testing\nspec:\n  tasks:\n  - name: apply-a-namespace\n    apply: \n      state: \n        kind: Namespace\n        apiVersion: v1\n        metadata:\n          name: my-ns\n  - name: create-a-pod\n    create: \n      state: \n        kind: Pod\n        apiVersion: v1\n        metadata:\n          name: my-pod\n          namespace: my-ns\n        spec:\n          containers:\n          - name: web\n            image: nginx\n  - name: delete-the-pod\n    delete: \n      state: \n        kind: Pod\n        apiVersion: v1\n        metadata:\n          name: my-pod\n          namespace: my-ns\n  - name: delete-the-namespace\n    delete: \n      state: \n        kind: Namespace\n        apiVersion: v1\n        metadata:\n          name: my-ns\n```\n\n### Programmatic vs. Declarative\nIt is important to understand that these declarative patterns are built upon programmatic ones. The low level constructs _(read native Kubernetes resources \u0026 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.\n\n### When to use D-operators\nD-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 \u0026 infrastructure in Kubernetes clusters.\n\n### Declarative Testing\nD-operators make use of its custom resource(s) to test its controllers. One can imagine these custom resources acting as the building blocks to implement a custom CI framework. One of the primary advantages with this approach, is to let custom resources remove the need to write code to implement test cases.\n\n_NOTE: One can make use of these YAMLs (kind: Recipe) to test any Kubernetes controllers declaratively_\n\nNavigate to test/declarative/experiments to learn more on these YAMLs.\n\n```sh\n# Following runs the declarative test suite\n#\n# NOTE: test/declarative/suite.sh does the following:\n# - d-operators' image known as 'dope' is built\n# - a docker container is started \u0026 acts as the image registry\n# - dope image is pushed to this image registry\n# - k3s is installed with above image registry\n# - d-operators' manifests are applied\n# - experiments _(i.e. test code written as YAMLs)_ are applied\n# - experiments are asserted\n# - if all experiments pass then this testing is a success else it failed\n# - k3s is un-installed\n# - local image registry is stopped\nsudo make declarative-test-suite\n```\n\n### Programmatic Testing\nD-operators also lets one to write testing Kubernetes controllers using Golang. This involves building the docker image (refer Dockerfile.testing) of the entire codebase and letting it run as a Kubernetes pod (refer test/integration/it.yaml). The setup required run these tests can be found at test/integration folder. Actual test logic are regular _test.go files found in respective packages. These _test.go files need to be tagged appropriately. These mode of testing has the additional advantage of getting the code coverage.\n\n```go\n// +build integration\n```\n\n```sh\nmake integration-test-suite\n```\n\n### Available Kubernetes controllers\n- [x] kind: Recipe\n- [ ] kind: RecipeClass\n- [ ] kind: RecipeGroupReport\n- [ ] kind: RecipeDebug\n- [ ] kind: Blueprint\n- [ ] kind: Validation\n- [ ] kind: CodeCov\n- [ ] kind: HTTP\n- [ ] kind: HTTPFlow\n- [ ] kind: Command\n- [ ] kind: DaemonJob\n- [ ] kind: UberLoop\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmayadata-io%2Fd-operators","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmayadata-io%2Fd-operators","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmayadata-io%2Fd-operators/lists"}