Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/giantswarm/operatorkit

An opinionated Go framework for developing Kubernetes operators
https://github.com/giantswarm/operatorkit

framework go kubernetes library operator

Last synced: about 1 month ago
JSON representation

An opinionated Go framework for developing Kubernetes operators

Awesome Lists containing this project

README

        

[![Go Reference](https://pkg.go.dev/badge/github.com/giantswarm/operatorkit.svg)](https://pkg.go.dev/github.com/giantswarm/operatorkit)
[![CircleCI](https://dl.circleci.com/status-badge/img/gh/giantswarm/operatorkit/tree/master.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/giantswarm/operatorkit/tree/master)

# operatorkit

**:warning: Important: This library has been deprecated in favor of [kubebuilder](https://book.kubebuilder.io/). Please, use kubebuilder if you want to create a new operator.**

Package `operatorkit` implements an opinionated framework for developing
[Kubernetes operators]. It emerged as we extracted common functionality from a
number of the operators we developed at [Giant Swarm][giantswarm]. The goal of
this library is to provide a common structure for operator projects and to
encapsulate best practices we learned while running operators in production.

## Features

- CRD primitives to reliably create, watch and delete custom resources, as well
as any Kubernetes runtime object.
- Managing [finalizers][finalizers] on reconciled objects, making sure the code
is executed at least once for each create/delete/update event.
- Guarantees to perform at least one successful deletion event reconciliation
to avoid unnecessary, possibly expensive interactions with third party
systems.
- Resource wrapping to gain ability of composing resources like middlewares.
- [Control Flow Primitives](docs/control_flow_primitives.md) that allow
cancellation and repetition of resource implementations.
- Independent packages. It is possible to use only certain parts of the library
without being bound to all primitives it provides.
- Ability to change behaviour that is often specific to an organization like
logging and error handling.
- [Pause Reconciliation](docs/pause_reconciliation.md) using pausing annotations
on runtime objects to stop and resume reconciliation on demand.

## Roadmap

For future planned features and breaking changes see the [roadmap](ROADMAP.md).

## Docs

- [Control Flow Primitives](docs/control_flow_primitives.md)
- [File Structure](docs/file_structure.md)
- [Keeping Reconciliation Loops Short](docs/keeping_reconciliation_loops_short.md)
- [Managing CR Status Sub Resources](docs/managing_cr_status_sub_resources.md)
- [Metrics Provider](docs/metrics_provider.md)
- [Pause Reconciliation](docs/pause_reconciliation.md)
- [Troubleshooting](docs/troubleshooting.md)
- [Using Finalizers](docs/using_finalizers.md)
- [Using Kubernetes Events](docs/using_kubernetes_events.md)

## Integration Tests

You can simply create a [`kind`](https://github.com/kubernetes-sigs/kind/)
cluster to run the integration tests.

```nohighlight
kind create cluster
```

The tests need to figure out how to connect to the Kubernetes cluster. Therefore
we need to set an environment variable pointing to your local kube config.

```nohighlight
export E2E_KUBECONFIG=~/.kube/config
```

Now you can easily run the integration tests.

```nohighlight
go test -v -tags=k8srequired ./integration/test/
```

Once you did your testing you may want to delete your local test cluster again.

```nohighlight
kind delete cluster
```

## Projects using operatorkit

[Giant Swarm operators] using `operatorkit`.

## Example

For a detailed state of art implementation, please see
[giantswarm/aws-operator](https://github.com/giantswarm/aws-operator).

## Contributing & Reporting Bugs

See [CONTRIBUTING](CONTRIBUTING.md) for details on submitting patches, the
contribution workflow as well as reporting bugs.

## License

`operatorkit` is under the Apache 2.0 license. See the [LICENSE](LICENSE) file
for details.

[finalizers]: https://kubernetes.io/docs/tasks/access-kubernetes-api/extend-api-custom-resource-definitions/#finalizers
[giantswarm]: https://giantswarm.io
[Giant Swarm operators]: https://github.com/search?p=1&q=topic%3Aoperator+org%3Agiantswarm&type=Repositories
[Kubernetes operators]: https://coreos.com/operators