operator-toolkit

module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2022 License: MIT

README

operator-toolkit

PkgGoDev Go Report Card Lint and test License

operator-toolkit provides framework and tools to help implement kubernetes operators.

Packages
controller

controller package provides tools to implement certain controller patterns.

  • controller/composite package contains interface and types to implement the composite controller pattern.
  • controller/sync package contains interface and types to implement sync controller pattern.
  • controller/external-object-sync package uses the sync pattern as the base and adds a garbage collector for collecting the orphan objects in external system.
  • controller/metadata-sync package uses the sync pattern as the base and adds a resync to periodically sync object metadata between systems.
  • controller/external package provides tools for building external controllers with the same core components that a k8s controller uses but for an external system based on non-k8s event source.
operator

operator package provides tools to implement the core business logic of an operator that interacts with the world. An Operand is a unit of work. An Operator can have one or more Operands. The relationship between the Operands is modelled using a Directed Asyclic Graph (DAG). The Operator can be configured to define how the Operands are executed.

declarative

declarative package provides tools to create and transform the kubernetes manifests in a declarative way. It uses kustomize tools to read, organize and transform the manifests with the desired configuration. This helps avoid writing Go structs for all the kubernetes objects and write generic reusable transforms.

rbac

rbac/client package provides a controller-runtime generic client implementation capable of recording the actions performed using the client on the objects and generate RBAC permissions as Role and ClusterRole.

telemetry

telemetry/export package provides opentelemetry exporters that can be used to enable telemetry in an operator.

webhook
  • webhook/cert package provides a local certificate manager that can provision self signed certificate for webhook server, backed by k8s secret for persistence, and refresh certificate when they expire automatically.

  • webhook/admission package provides a consistent way of building admission controllers for k8s native and custom resources with function chaining support.

The above packages can be used together or independently of each other. example/ contains an example of using all the packages together in a kubebuilder based operator.

Directories

Path Synopsis
api-object
v1
Package cache provides a client-go informer based cache that can be populated with any API server objects, not just kubernetes API objects.
Package cache provides a client-go informer based cache that can be populated with any API server objects, not just kubernetes API objects.
informer
Package informer is based on internal package https://github.com/kubernetes-sigs/controller-runtime/tree/v0.8.3/pkg/cache/internal, modified to not be kubernetes API specific.
Package informer is based on internal package https://github.com/kubernetes-sigs/controller-runtime/tree/v0.8.3/pkg/cache/internal, modified to not be kubernetes API specific.
client
composite
Package composite provides a k8s client composed of a cached and an uncached client.
Package composite provides a k8s client composed of a cached and an uncached client.
composite/v1
Package v1 contains helpers to build a composite controller reconciler.
Package v1 contains helpers to build a composite controller reconciler.
composite/v1/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
external
Package external provides tools to build an external controller with the same core components that a k8s controller uses.
Package external provides tools to build an external controller with the same core components that a k8s controller uses.
external-object-sync/v1
Package v1 provides helpers to implement an external object sync controller.
Package v1 provides helpers to implement an external object sync controller.
external-object-sync/v1/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
metadata-sync/v1/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
stateless-action/v1
Package v1 provides helpers for building a stateless-action controller.
Package v1 provides helpers for building a stateless-action controller.
stateless-action/v1/action
Package action defines and interface for action Manager.
Package action defines and interface for action Manager.
stateless-action/v1/action/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
stateless-action/v1/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
sync/v1
Package v1 provides helpers to build a sync controller.
Package v1 provides helpers to build a sync controller.
sync/v1/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
The declarative package contains tools for building the manifests that the operators use in a declarative manner.
The declarative package contains tools for building the manifests that the operators use in a declarative manner.
deleter
Package deleter provides a kubectl deleter that can be easily imported and used to delete resources.
Package deleter provides a kubectl deleter that can be easily imported and used to delete resources.
kubectl
Package kubectl provides interface and default implementation of kubectl client to be used declaratively.
Package kubectl provides interface and default implementation of kubectl client to be used declaratively.
kustomize
Package kustomize provides tools to interact with kustomization files.
Package kustomize provides tools to interact with kustomization files.
discovery
cluster
Package cluster helps with cluster discovery related operations.
Package cluster helps with cluster discovery related operations.
Package error provides interfaces for errors to implement and behavior based error checking helper functions.
Package error provides interfaces for errors to implement and behavior based error checking helper functions.
event
v1
Package v1 contains an interface that a controller should use to define all the events take place when the controller reconciles.
Package v1 contains an interface that a controller should use to define all the events take place when the controller reconciles.
example module
internal
pkiutil
Package pkiutil provides utilities to help with certificates and keys.
Package pkiutil provides utilities to help with certificates and keys.
webhook
NOTE: This package originates from controller-runtime v0.1.
NOTE: This package originates from controller-runtime v0.1.
webhook/cert/generator
NOTE: This package originates from controller-runtime v0.1.
NOTE: This package originates from controller-runtime v0.1.
webhook/cert/writer
NOTE: This package originates from controller-runtime v0.1.
NOTE: This package originates from controller-runtime v0.1.
Package object contains helpers to work with Kubernetes objects.
Package object contains helpers to work with Kubernetes objects.
operator
v1
Package v1 contains helpers to build an operator component of a controller reconciler.
Package v1 contains helpers to build an operator component of a controller reconciler.
v1/dag
Package dag helps create a directed asyclic graph(DAG) of the operands in an operator based on the relationship between the operands.
Package dag helps create a directed asyclic graph(DAG) of the operands in an operator based on the relationship between the operands.
v1/executor
Package executor contains types and functions to help with the execution of the operands.
Package executor contains types and functions to help with the execution of the operands.
v1/operand
Package operand defines an operand interface.
Package operand defines an operand interface.
v1/operand/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package predicate defines Predicates used by Controllers to filter Events before they are provided to EventHandlers.
Package predicate defines Predicates used by Controllers to filter Events before they are provided to EventHandlers.
rbac
client
Package client provides an implementation of the controller-runtime's generic client with RBAC recording action recording.
Package client provides an implementation of the controller-runtime's generic client with RBAC recording action recording.
Package source is a modification of the controller-runtime pkg/source package to use the same Kind based source but without the hard requirement to register them with the k8s API server.
Package source is a modification of the controller-runtime pkg/source package to use the same Kind based source but without the hard requirement to register them with the k8s API server.
internal
This is taken from https://github.com/kubernetes-sigs/controller-runtime/blob/v0.8.3/pkg/source/internal/eventsource.go.
This is taken from https://github.com/kubernetes-sigs/controller-runtime/blob/v0.8.3/pkg/source/internal/eventsource.go.
Package telemetry provides helpers to setup operator telemetry tooling easily.
Package telemetry provides helpers to setup operator telemetry tooling easily.
export
Package export provides telemetry exporters for various providers.
Package export provides telemetry exporters for various providers.
webhook
admission
Package admission provides interfaces for building admission controllers with chaining function with support for both k8s native and custom resources in a consistent way.
Package admission provides interfaces for building admission controllers with chaining function with support for both k8s native and custom resources in a consistent way.
builder
Package builder is based on the controller-runtime webhook builder.
Package builder is based on the controller-runtime webhook builder.
cert
Package cert provides a secret based certificate manager for webhook servers.
Package cert provides a secret based certificate manager for webhook servers.
function
Package function contains common defaulting and validating functions that can be imported and used in any admission controllers.
Package function contains common defaulting and validating functions that can be imported and used in any admission controllers.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL