-
Notifications
You must be signed in to change notification settings - Fork 1
Introduction
Metatron is a Ruby library for creating Metacontroller-based custom Kubernetes controllers.
The intention is to make it as easy as possible to use Ruby to manage custom resources within your Kubernetes infrastructure. No Golang required to listen for and respond to resources based on your own CustomResourceDefinition
or to modify existing kubernetes resources via a DecoratorController
.
Your Ruby code doesn't have to have any real knowledge of the Kubernetes environment in which it operates; Metacontroller takes care of all the Kubernetes interactions and Metatron handles providing the JSON interface. Just write a sync
method that can receive and respond with the appropriate Hashes and you're on your way!
Metatron is built to be usable quickly either in a small, simple Ruby project or embedded in a Rails application (and everything in between). It's also built to be extensible, so you can add your own custom functionality to the controllers you create.
Overview of Metatron Components
Metacontroller is a Kubernetes controller that can generate and manage other Kubernetes controllers. It's a great way to extend Kubernetes without having to deal with heavier tools like Operator SDK or Kubebuilder. It was originally created by Google with the intention of making it easier to create custom controllers in a variety of languages.
Metatron provides a Ruby interface to the Metacontroller API. It handles the JSON serialization and deserialization of the data sent to and from Metacontroller, so you can focus on writing the code that will actually manage your resources.
More specifically, Metatron provides:
- Base classes for creating Metacontroller controllers, simplifying the process and ensuring that your controllers are compatible with Metacontroller.
- Built-in compatibility with Metacontroller features like
ETag
support,Content-Type
negotiation, and more to come.
- Built-in compatibility with Metacontroller features like
- Easy-to-use templates for creation standard Kubernetes resources (e.g.
Deployment
,Service
,ConfigMap
, etc.) using Ruby objects. - Simple support for additional custom resources via Ruby hashes.