github.com/jingruilea/kubeedge@v1.2.0-beta.0.0.20200410162146-4bb8902b3879/docs/proposals/EdgeSite.md (about)

     1  ---
     2  title: EdgeSite Design
     3  status: implementable
     4  authors: 
     5    - "@cindyxing"
     6  approvers:
     7    - "@qizha"
     8    - "@kevin-wangzefeng"
     9    - "@m1093782566"
    10  ---
    11  # EdgeSite: Standalone Cluster at edge
    12  
    13  ## Abstract
    14  In Edge computing, there are scenarios where customers would like to have a whole cluster installed at edge location. As a result, 
    15  admins/users can leverage the local control plane to implement management functionalities and take advantages of all edge computing's benefits. 
    16  
    17  This design doc is to enable customers deploy and run lightweight clusters at edge. 
    18  
    19  ## Motivation
    20  There are scenarios user need to run a standalone Kubernetes cluster at edge to get full control and improve the offline scheduling capability. There are two scenarios user need to do that:
    21  
    22  * The edge cluster is in CDN instead of the user's site
    23  
    24    The CDN sites usually be large around the world and the network connectivity and quality cannot be guaranteed. Another factor is that the application deployed in CDN edge do not need to interact with center usually. For those deploy edge cluster in CDN resources, they need to make sure the cluster is workable without the connection with central cloud not only for the deployed applicatons but also the schedule capabilities. So that the CDN edge is manageable regardless the connection to one center.
    25  
    26  * User need to deploy an edge environment with limited resources and offline running for most of the time
    27  
    28    In some IOT scenarios, user need to deploy a full control edge environment and running offline.
    29  
    30  For these use cases, a standalone, full controlled, light weight Edge cluster is required.
    31  By integrating KubeEdge and standard Kubernetes, this proposal enables customers to run an efficient kubernetes cluster for Edge/IOT computing. User can also leverage other smaller Kubernetes implementation such as K3S to make the footprint even smaller.
    32  
    33  ## Assumptions
    34  Here we assume a cluster is deployed at edge location including the management control plane. 
    35  For the management control plane to manage some scale of edge worker nodes, the hosting master node needs to have sufficient resources. 
    36  The assumptions are
    37  1. EdgeSite cluster master node is of no less than 2 CPUs and no less than 1GB memory
    38  2. If high availability is required, 2-3 master nodes are needed at different edge locations
    39  3. The same Kubernetes security (authN and authZ) mechanisms are used to ensure the secure handshake between master and worker nodes
    40  4. The same K8s HA mechanism is to be used to enable HA
    41  
    42  ## Architecture Design
    43  <img src="../images/edgesite/EdgeSite_arch.PNG"/>
    44  
    45  ## Advantages
    46  With the integration, the following can be enabled
    47  
    48  1. Full control of Kubernetes cluster at edge
    49  2. Light weight control plane and agent
    50  3. Edge worker node autonomy in case of network disconnection/reconnection
    51  4. All benefits of edge computing including latency, data locality, etc.
    52  
    53  ## Protocol 
    54  K8s client library interface will be used. The edgecontroller on each edge node only watches against k8s types for the node itself. 
    55  
    56  The informer programming model will be used between EdgeController and APIServer. 
    57  For example:
    58  
    59  ```go
    60  informer := factory.Core().V1().Pods().Informer()
    61  stopper := make(chan struct{})
    62  defer close(stopper)
    63  
    64  informer.AddEventHandler(cache.ResourceEventHandlerFuncs{
    65      AddFunc: func(obj interface{}) {
    66          // "k8s.io/apimachinery/pkg/apis/meta/v1" provides an Object
    67          // interface that allows us to get metadata easily
    68          mObj := obj.(v1.Object)
    69          log.Printf("New Pod Added to Store: %s", mObj.GetName())
    70      },
    71  })
    72  ```
    73  
    74  And the data can be written to the client side store. 
    75  
    76  ## Work Items
    77  1. Port current EdgeController code to KubeEdge agent side
    78  2. Make cloudhub/edgehub optional
    79  3. Come up with lightweight etcd
    80  
    81     For lightweight etcd, we keep etcdv3 implementation and remove v2; and some other items.
    82  
    83  4. Lightweight kubeproxy on edgecore
    84  5. E2E 
    85  
    86