GithubHelp home page GithubHelp logo

doytsujin / controllermesh Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openkruise/controllermesh

0.0 1.0 0.0 10.13 MB

ControllerMesh is a solution that helps developers manage their controllers/operators better with enhanced isolation.

License: Apache License 2.0

Shell 3.16% Go 92.80% Makefile 2.80% Dockerfile 1.24%

controllermesh's Introduction

ControllerMesh

ControllerMesh is a solution that helps developers manage their controllers/operators better.

Key Features

  1. Canary update: the controllers can be updated in canary progress instead of one time replace.
  2. Fault injection: it helps developers to verify their reconcile logic in some fault scenarios.
  3. Flexible isolation: limits resources of which namespaces can be queried by a controller.
  4. Client-side rate-limit and blown.

Implementation Constraints

Generally, a ctrlmesh-proxy container will be injected into each operator Pod that has configured in ControllerMesh. This proxy container will intercept and handle the connection by between API Server and controllers/webhooks in the Pod.

The ctrlmesh-manager dispatches rules to the proxies, so that they can route requests according to the rules.

A core CRD in ControllerMesh is VirtualApp. It contains all rules for user's controller and webhook:

apiVersion: ctrlmesh.kruise.io/v1alpha1
kind: VirtualApp
metadata:
  name: test-operator
  # ...
spec:
  selector:
    matchLabels:
      component: test-operator
  configuration:
    controller:
      leaderElectionName: test-operator
    webhook:
      certDir: /tmp/webhook-certs
      port: 9443
  route:
    globalLimits:
    - namespaceSelector:
        matchExpressions:
        - key: ns-type
          operator: NotIn
          values:
          - system
    subRules:
    - name: canary-rule
      match:
      - namespaceSelector:
          matchLabels:
            ns-type: canary-1
      - namespaceRegex: "^canary.*"
  subsets:
  - name: v2
    labels:
      version: v2
    routeRules:
    - canary-rule
  • selector: for all pods of the test-operator
  • configuration:
    • controller: configuration for controller, including leader election name
    • webhook: configuration for webhook, including certDir and port of this webhook
  • route:
    • globalLimits: limit rules that enable to all pods of test-operator
    • subRules: multiple rules that can define to be used in subsets
  • subsets: multiple groups of the pods, each subset has specific labels and its route rules

Flow control

ControllerMesh will firstly support Hard Limit type of flow control, which means the ctrlmesh-proxy will filter unmatched requests/responses between API Server and local controller/webhook.

Controller:

Webhook:

Risks and Mitigations

  1. The controller/webhook can not get any requests if ctrlmesh-proxy container crashes.
  2. Developers can not change the flow rules of their operators if kruise-manager is not working.
  3. The performance of controller/webhook will be a little worse.
  4. Pod of the operator requires a few more resources because of a ctrlmesh-proxy container injected into it.

License

ControllerMesh is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

controllermesh's People

Contributors

fillzpp avatar eikykun 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.