Coder Social home page Coder Social logo

podset-operator's Introduction

PodSet Operator

Objective of this Operator/Controller is demonstrate ReplicaSet kind of resource implementation using Kubernetes controller pattern. Another objective of this repo. is to show how to build the controller from scratch and what challenges a developer could face. So that a developer could understand the beauty KuberBuilder or Operator SDK frameworks

PodSet resource

Once user applies the PodSet (kubectl apply -f podset.yaml) resource, controller could spin up number of pods mentioned as per replicas filed.

e.g. User want to spin up 3 pod

apiVersion: demo.k8s.io/v1alpha1
kind: PodSet
metadata:
  name: three-podset
spec:
  replicas: 3

Prerequisites

  • Kubernetes cluster 1.9 + (minikube also works)
  • golang 1.11 +
  • set GO111MODULE="on" env if source code is in $GOPATH

Presentation

Presentation deck

Tutorial

Check out the code according to following instruction and check the README file to follow the further instructions.

step 1

git checkout step-1

covers basic code and scaffolding setup

step 2

git checkout step-2

Covers how to define CRD types, register CRD's and generate client API's using go-client and generators It covers simple program that issues watch request to PodSet resource and print's resource state changes on console.

step 3

git checkout step-3

Covers functional controller using basic generated code. It shows how to issue watch requests and bring PodSet resource to desired state (reconciliation).

step 4

git checkout step-4

Covers fully functional controller using shared informers, listers and workqueues. It shows how to generate all those objects. At this point one could able to relate why controllers are written in particular way.

Note: This code is intended for educational purpose. While less focus is given on code quality aspect.

Credits

podset-operator's People

Contributors

hrishin avatar rohankanojia avatar

Stargazers

Lalatendu Mohanty avatar Ioannis Plakas avatar  avatar Naresh Kumar avatar sunshanpeng avatar  avatar  avatar Nikhil Thomas avatar Suman Mandal avatar  avatar

Watchers

James Cloos 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.