Git Product home page Git Product logo

echoperator's Introduction

๐Ÿค– echoperator

CI Release Go Report Card Go Reference Artifact HUB License: MIT

Simple Kubernetes operator built from scratch with client-go.

Kubernetes operator pattern implementation using the client-go library. Altough there are a bunch of frameworks for doing this (kubebuilder, operator framework ...), this example operator uses the tools provided by client-go for simplicity and flexibility reasons.

Medium article that explains how to build this operator step by step.

Features

  • Simple example to understand how a Kubernetes operator works.
  • Manages Echo CRDs for executing an echo inside a pod.
  • Manages ScheduledEcho CRDs for scheduling the execution of an echo inside a pod.
  • High Availability operator using Kubernetes lease objects.
  • Prometheus metrics.
  • Helm chart.

Versioning

Echo ScheduledEcho Job CronJob Lease Kubernetes
v1alpha1 v1alpha1 v1 v1 v1 v1.21.x

Installation

helm repo add mmontes https://mmontes11.github.io/charts
helm install echoperator mmontes/echoperator

Custom Resource Definitions (CRDs)

The helm chart installs automatically the Custom Resource Definitions needed for this operator to work. However, if you wanted to install them manually, you can find them in the helm chart repo.

Example use cases

Hello world
  • Client creates a hello world Echo CRD.
  • Operator receives a Echo added event.
  • Operator reads the message property from the Echo and creates a Job resource.
  • The Job resource creates a Pod that performs a echo command with the message property.
Scheduled hello world
  • Client creates a hello world ScheduledEcho CRD.
  • Operator receives a ScheduledEcho added event.
  • Operator reads the message and schedule property from the ScheduledEcho and creates a CronJob.
  • The CronJob schedules a Job creation using the schedule property.
  • When scheduled, the Job resource creates a Pod that performs a echo command with the message property.

echoperator's People

Contributors

mmontes11 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.