Giter Club home page Giter Club logo

porter's Introduction

GitHub version go report

Porter

Porter is a load balancer for physical machine deployment Kubernetes. The load balancer is implemented using physical switches, leveraging BGP and ECMP for optimal performance and high availability. We know that in the Kubernetes environment deployed on the cloud, the cloud service provider usually provides the cloud LB plugin to expose the Kubernetes service to the external network. However, in the physical machine deployment environment, because the cloud environment is not available, the service is exposed to the external network. Porter is A plug-in that provides users with exposed services in the physical environment and exposed service consistency experiences on the cloud. The plugin provides two major functional modules:

  1. The LB controller and the agent: controller are responsible for synchronizing the BGP routes to the physical switch; the agent is deployed to the node in the DaemonSet mode to maintain the drainage rules.
  2. The EIP service, including the EIP pool management and EIP controller, is responsible for updating the EIP information of the service.

Porter is a subproject of KubeSphere.

Physical deployment architecture

The following figure is a physical deployment architecture diagram. Suppose a service is deployed on node1 (192.168.0.2) and node2 (192.168.0.6). The service needs to be accessed through public IP 1.1.1.1. After the service deployer deploys the service according to the example. Porter will automatically synchronize routing information to the leaf switch, and then synchronize to the spine, border switch, Internet users can directly access the service through EIP 1.1.1.1.

node architecture

Plug-in deployment architecture

The plug-in monitors changes in the service in the cluster through a Manager and broadcasts related routes. At the same time, all the nodes in the cluster are deployed with an agent. Whenever an EIP is used, a host routing rule is added to the host to divert the IP packets sent to the EIP to the local device.

porter deployment

Plugin Logic

When the plug-in is deployed as a service in a Kubernetes cluster, it establishes a BGP connection with the cluster's border router (Layer 3 switch). Whenever a service with a specific annotation (an annotation is lb.kubesphere.io/v1apha1: porter, see example) is created in the cluster, it is dynamically allocated for the service. EIP (users can also specify EIPs themselves). The LB controller creates routes and routes them to the public network (private network) through BGP, so that external services can be accessed.

The Porter LB controller is a custom controller based on Kubernetes controller runtime that automatically changes routing information through changes to the watch service.

porter architecture

Deploying plugins

  1. Deployed on a physically deployed k8s cluster
  2. Testing with an analog router on Qingyun

Building a new plugin from code

Software Requirements

  1. go 1.11, the plugin uses gobgp to create the BGP server, gobgp needs go 1.11
  2. docker, no version limit
  3. kustomize, the plugin uses kustomize to dynamically generate the k8s yaml files needed for the cluster
  4. If the plugin is pushed to the remote private repository, you need to execute docker login in advance.

Step

  1. git clone https://github.com/kubesphere/porter.git, enter the code directory
  2. Modify config.toml (located under config/bgp/) as required in the tutorial above.
  3. (optional) modify the code according to your needs
  4. (optional) modify the parameters of the image according to your needs (located under config/manager)
  5. (optional) Follow the Simulation Tutorial to deploy a Bird host, modify the BirdIP in hack/e2e.sh, and then run make e2e-test for e2e testing.
  6. Modify the IMG name in the Makefile, then make release, and the final yaml file in the deploy directory
  7. kubectl apply -f deploy/release.yaml deployment plugin

Open source license

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

porter's People

Contributors

georgeguo2018 avatar rayzhou2017 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.