All Projects → jvm-operators → abstract-operator

jvm-operators / abstract-operator

Licence: Apache-2.0 license
Library/SDK for creating the operators for Kubernetes and Openshift.

Programming Languages

java
68154 projects - #9 most used programming language
shell
77523 projects
Makefile
30231 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to abstract-operator

Benchmark Operator
The Chuck Norris of cloud benchmarks
Stars: ✭ 130 (+116.67%)
Mutual labels:  openshift, kubernetes-operator
grafana-operator
An operator for Grafana that installs and manages Grafana instances, Dashboards and Datasources through Kubernetes/OpenShift CRs
Stars: ✭ 449 (+648.33%)
Mutual labels:  openshift, kubernetes-operator
spark-operator
Operator for managing the Spark clusters on Kubernetes and OpenShift.
Stars: ✭ 129 (+115%)
Mutual labels:  openshift, kubernetes-operator
K8up
Kubernetes and OpenShift Backup Operator
Stars: ✭ 130 (+116.67%)
Mutual labels:  openshift, kubernetes-operator
Argocd Operator
A Kubernetes operator for managing Argo CD clusters.
Stars: ✭ 151 (+151.67%)
Mutual labels:  openshift, kubernetes-operator
pulp-operator
Kubernetes Operator for Pulp 3. Under active development.
Stars: ✭ 32 (-46.67%)
Mutual labels:  openshift, kubernetes-operator
Strimzi Kafka Operator
Apache Kafka running on Kubernetes
Stars: ✭ 2,833 (+4621.67%)
Mutual labels:  openshift, kubernetes-operator
infinispan-operator
Infinispan Operator
Stars: ✭ 32 (-46.67%)
Mutual labels:  openshift, kubernetes-operator
logging-operator
A golang based operator to create and manage EFK (Elasticsearch, Fluentd, and Kibana) stack on Kubernetes
Stars: ✭ 42 (-30%)
Mutual labels:  openshift
deploy
No description or website provided.
Stars: ✭ 23 (-61.67%)
Mutual labels:  openshift
codewind-vscode
Extension for developing cloud-native, containerized applications from VS Code
Stars: ✭ 17 (-71.67%)
Mutual labels:  openshift
mlx
Machine Learning eXchange (MLX). Data and AI Assets Catalog and Execution Engine
Stars: ✭ 132 (+120%)
Mutual labels:  openshift
kotary
Managing Kubernetes Quota with confidence
Stars: ✭ 85 (+41.67%)
Mutual labels:  kubernetes-operator
zookeeper-k8s-openshift
Zookeeper docker container, ready for deployments on kubernetes and openshift
Stars: ✭ 22 (-63.33%)
Mutual labels:  openshift
openshift-update-graph
Visualize the OpenShift Update Graph
Stars: ✭ 20 (-66.67%)
Mutual labels:  openshift
airlock-waf-kubernetes-openshift-integration
Integrate Airlock WAF in a Kubernetes or OpenShift Environment
Stars: ✭ 12 (-80%)
Mutual labels:  openshift
bobbycar
IoT Transportation demo using Red Hat OpenShift and Middleware technologies
Stars: ✭ 33 (-45%)
Mutual labels:  openshift
oshinko-s2i
This is a place to put s2i images and utilities for spark application builders for openshift
Stars: ✭ 16 (-73.33%)
Mutual labels:  openshift
deploy
Deploy Development Builds of Open Cluster Management (OCM) on RedHat Openshift Container Platform
Stars: ✭ 133 (+121.67%)
Mutual labels:  openshift
freya
Scala Kubernetes Operator library
Stars: ✭ 40 (-33.33%)
Mutual labels:  kubernetes-operator

abstract-operator

Build status License

{CRD|ConfigMap}-based approach for lyfecycle management of various resources in Kubernetes and OpenShift. Using the Operator pattern, you can leverage the Kubernetes control loop and react on various events in the cluster. The idea of the operator patern is to encapsulate the operational knowledge into the abovementioned control loop and declarative approach.

Example Implementations

Code

This library can be simply used by adding it to classpath; creating a new class that extends AbstractOperator. This 'concrete operator' class needs to also have the @Operator annotation on it. For capturing the information about the monitored resources one has to also create a class that extends EntityInfo and have arbitrary fields on it with getters and setters.

This class can be also generated from the JSON schema. To do that add jsonschema2pojo plugin to the pom.xml and json schema to resources (example).

This is a no-op operator in Scala that simply logs into console when config map with label radanalytics.io/kind = foo is created.

@Operator(forKind = "foo", prefix = "radanalytics.io", infoClass = classOf[FooInfo])
class FooOperator extends AbstractOperator[FooInfo] {
  val log: Logger = LoggerFactory.getLogger(classOf[FooInfo].getName)

  @Override
  def onAdd(foo: FooInfo) = {
    log.info(s"created foo with name ${foo.name} and someParameter = ${foo.someParameter}")
  }

  @Override
  def onDelete(foo: FooInfo) = {
    log.info(s"deleted foo with name ${foo.name} and someParameter = ${foo.someParameter}")
  }
}

CRDs

By default the operator is based on CustomResources, if you want to create ConfigMap-based operator, add crd=false parameter in the @Operator annotation. The CRD mode will try to create the custom resource definition from the infoClass if it's not already there and then it listens on the newly created, deleted or modified custom resources (CR) of the given type.

For the CRDs the:

  • forKind field represent the name of the CRD ('s' at the end for plural)
  • prefix field in the annotation represents the group
  • shortNames field is an array of strings representing the shortened name of the resource.
  • pluralName field is a string value representing the plural name for the resource.
  • enabled field is a boolean value (default is true), if disabled the operator is silenced
  • as for the version, currently the v1 is created automatically, but one can also create the CRD on his own before running the operator and providing the forKind and prefix matches, operator will use the existing CRD

Configuration

You can configure the operator using some environmental variables. Here is the list:

  • WATCH_NAMESPACE, example values myproject, foo,bar,baz, * - what namespaces the operator should be watching for the events, if left empty, all namespace will be used (same as *). One may also use special value ~ denoting the same namespace where the operator is deployed in.
  • CRD, values true/false - config maps = false, custom resources = true, default: true
  • COLORS, values true/false - if true there will be colors used in the log file, default: true
  • METRICS, values true/false - whether start the simple http server that exposes internal metrics. These metrics are in the Prometheus compliant format and can be scraped by Prometheus; default: true
  • METRICS_JVM, values true/false - whether expose also internal JVM metrics such as heap usage, number of threads and similar; default: false
  • METRICS_PORT, example values 1337; default: 8080

Documentation

javadoc

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].