github.com/jingruilea/kubeedge@v1.2.0-beta.0.0.20200410162146-4bb8902b3879/docs/modules/cloud/controller.md (about) 1 # Edge Controller 2 3 4 ## Edge Controller Overview 5 EdgeController is the bridge between Kubernetes Api-Server and edgecore 6 7 8 ## Operations Performed By Edge Controller 9 10 The following are the functions performed by Edge controller :- 11 - Downstream Controller: Sync add/update/delete event to edgecore from K8s Api-server 12 - Upstream Controller: Sync watch and Update status of resource and events(node, pod and configmap) to K8s-Api-server and also subscribe message from edgecore 13 - Controller Manager: Creates manager Interface which implements events for managing ConfigmapManager, LocationCache and podManager 14 15 16 ## Downstream Controller: 17 ### Sync add/update/delete event to edge 18 19 - Downstream controller: Watches K8S-Api-server and sends updates to edgecore via cloudHub 20 - Sync (pod, configmap, secret) add/update/delete event to edge via cloudHub 21 - Creates Respective manager (pod, configmap, secret) for handling events by calling manager interface 22 - Locates configmap and secret should be send to which node 23 24  25 ## Upstream Controller: 26 ### Sync watch and Update status of resource and events 27 28 - UpstreamController receives messages from edgecore and sync the updates to K8S-Api-server 29 - Creates stop channel to dispatch and stop event to handle pods, configMaps, node and secrets 30 - Creates message channel to update Nodestatus, Podstatus, Secret and configmap related events 31 - Gets Podcondition information like Ready, Initialized, Podscheduled and Unschedulable details 32 - **Below is the information for PodCondition** 33 - **Ready**: PodReady means the pod is able to service requests and should be added to the load balancing pools for all matching services 34 - **PodScheduled**: It represents status of the scheduling process for this pod 35 - **Unschedulable**: It means scheduler cannot schedule the pod right now, may be due to insufficient resources in the cluster 36 - **Initialized**: It means that all Init containers in the pod have started sucessfully 37 - **ContainersReady**: It indicates whether all containers in the pod are ready 38 - **Below is the information for PodStatus** 39 - **PodPhase**: Current condition of the pod 40 - **Conditions**: Details indicating why the pod is in this condition 41 - **HostIP**: IP address of the host to which pod is assigned 42 - **PodIp**: IP address allocated to the Pod 43 - **QosClass**: Assigned to the pod based on resource requirement 44 45  46 47 ## Controller Manager: 48 ### Creates manager Interface and implements ConfigmapManager, LocationCache and podManager 49 50 - Manager defines the Interface of a manager, ConfigManager, Podmanager, secretmanager implements it 51 - Manages OnAdd, OnUpdate and OnDelete events which will be updated to the respective edge node from the K8s-Api-server 52 - Creates an eventManager(configMaps, pod, secrets) which will start a CommonResourceEventHandler, NewListWatch and a newShared Informer for each event to Sync(add/update/delete)event(pod, configmap, secret) to edgecore via cloudHub 53 - **Below is the List of handlers created by controller Manager** 54 - **CommonResourceEventHandler**: NewcommonResourceEventHandler creates CommonResourceEventHandler used for Configmap and pod Manager 55 - **NewListWatch**: Creates a new ListWatch from the specified client resource namespace and field selector 56 - **NewSharedInformer**: Creates a new Instance for the Listwatcher