operatorlib

module
v0.0.0-...-a212bfd Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2019 License: BSD-3-Clause

README

Operator Library

Godoc Reference Go Report Card Build Status codecov Maintainability BSD License

About

While working on many Kubernetes operators, I realised that a lot of code is repetative across operators. Generating, creating, updating, deleting objects is a common thing and yet the code is being repeated in every operator. I decided to work on project which removes the the repeatative code from all Kubernetes Operators. The benefits of this approach are that common well tested and stable functions can be used by all operators. Also, this kind of tries to reduce the complexity of dealing with Kubernetes objects which (hopefully!) will lead to more and more vendors building there own operators. This project also attempts to reduce the overall work required to build the operator which means operators for small projects can be build quickly.

Usage

The Kubernetes interactions are abstracted away so you do not have to care about the Client for the simple usage. For instance, if you want to create a ConfigMap object using Operatorlib, import configmap package and add the following lines of code whereever it seems fit.

import "github.com/ankitrgadiya/operatorlib/pkg/configmap

...
	result, err := configmap.CreateOrUpdate(configmap.Conf{
		Name: "test",
		Namespace: "default",
	})
	if err != nil {
		return result, err
	}
...

This however will create an empty Configmap. To see all the options check the Conf section in the documentation. Check the list of supported objects below. Operatorlib also provides low-level package operation which can be used to create all non-supported objects (including custom objects) as long as they implement Object interface defines in interface package.

Supported Objects

License

BSD 3-Clause License

Directories

Path Synopsis
pkg
configmap
Package configmap provides functions for manipulating Configmap object in Kubernetes cluster.
Package configmap provides functions for manipulating Configmap object in Kubernetes cluster.
interfaces/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
operation
Package operation implements lower-level functions to be used by any Kubernetes Object.
Package operation implements lower-level functions to be used by any Kubernetes Object.
secret
Package secret provides functions for manipulating Secret object in Kubernetes cluster
Package secret provides functions for manipulating Secret object in Kubernetes cluster
service
Package service provides functions for manipulating Service object in Kubernetes cluster.
Package service provides functions for manipulating Service object in Kubernetes cluster.

Jump to

Keyboard shortcuts

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