Code Monkey home page Code Monkey logo

yarp-cni's Introduction

yarp-cni - Yet Another Random Plugin (Kubernetes CNI Edition)

A random, simplied, and most likely kinda broken CNI implementation I started as a review work for CKA exam. TLDR: It works, its just not finished.

Components

The same binary serves 2 main functions via the PLUGIN_MODE environment variable.

PLUGIN_MODE == ROUTER (WIP)

This mode is intended to run as daemon-set. In this mode, each pod (on each Node) will do the following actions:

  • On startup, it checks the ConfigMap yarp-routing-table and allocates a subnet for the node it lives on (for example a /24) and registers it back on the ConfigMap. The structure should be something like this:
apiVersion: v1
kind: ConfigMap
metadata:
  name: yarp-routing-table
  namespace: kube-system
data:
  master1: 10.244.0.0/24
  node1: 10.244.1.0/24
  node2: 10.244.2.0/24
  • On startup, it writes an IPAM db file locally to the node with metadata information to be leverage by the CNI mode. The DB structure is:
{
  "CIDR": "10.244.1.0/24",
  "AllocatedIps": []
}
  • A long-living process that monitors for changes in the yarp-routing-table ConfigMap and watches for changes in Nodes. On changes, it will ensure that the local ip-routes are up-to-date to ensure all pods can reach each other over the network. It essentially implements a Router/RoutingTable.

PLUGIN_MODE == CNI

This mode is invoked by Kubelet during Pod setup. This project currently implements spec 0.3.1. For more information check https://github.com/containernetworking/cni/blob/master/SPEC.md

IPAM is managed via the ipam.db file. Its similar to the host-local.

yarp-cni's People

Contributors

bmiguel-teixeira avatar

Stargazers

algazali hamid avatar

Watchers

 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.