Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Course Task] fix-doc-edge-controller #278

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 34 additions & 32 deletions content/en/docs/architecture/cloud/edge_controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,63 +2,65 @@
draft: false
linktitle: Edge Controller
menu:
docs:
parent: Cloud Components
weight: 2
  docs:
    parent: Cloud Components
    weight: 2
title: Edge Controller
toc: true
type: docs
---


## Edge Controller Overview
EdgeController is the bridge between Kubernetes Api-Server and edgecore
 EdgeController is the bridge between Kubernetes Api-Server and edgecore


## Operations Performed By Edge Controller

The following are the functions performed by Edge controller :-
- Downstream Controller: Sync add/update/delete event to edgecore from K8s Api-server
- 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
- Controller Manager: Creates manager Interface which implements events for managing ConfigmapManager, LocationCache and podManager
The following are the functions performed by Edge controller:
- Downstream Controller: Sync add/update/delete event to edgecore from K8s Api-server
- Upstream Controller: Sync watch and update the status of resource and events(node, pod and configmap) to K8s Api-server and also subscribe message from edgecore
- Controller Manager: Creates manager interface which implements events for managing ConfigmapManager, LocationCache and podManager


## Downstream Controller:
### Sync add/update/delete event to edge

- Downstream controller: Watches K8S-Api-server and sends updates to edgecore via cloudHub
- Downstream controller: Watches K8S Api-server and sends updates to edgecore via cloudHub
- Sync (pod, configmap, secret) add/update/delete event to edge via cloudHub
- Creates Respective manager (pod, configmap, secret) for handling events by calling manager interface
- Locates configmap and secret should be send to which node

![Downstream Controller](/img/edgecontroller/DownstreamController.png)
![Downstream Controller](/static/img/edgecontroller/DownstreamController.png)
## Upstream Controller:
### Sync watch and Update status of resource and events
### Sync watch and update status of resource and events

- UpstreamController receives messages from edgecore and sync the updates to K8S-Api-server
- UpstreamController receives messages from edgecore and syncs the updates to K8S-Api-server
- Creates stop channel to dispatch and stop event to handle pods, configMaps, node and secrets
- Creates message channel to update Nodestatus, Podstatus, Secret and configmap related events
- Gets Podcondition information like Ready, Initialized, Podscheduled and Unschedulable details
- Gets pod condition information like Ready, Initialized, Podscheduled and Unschedulable details
- **Below is the information for PodCondition**
- **Ready**: PodReady means the pod is able to service requests and should be added to the load balancing pools for all matching services
- **PodScheduled**: It represents status of the scheduling process for this pod
- **Unschedulable**: It means scheduler cannot schedule the pod right now, may be due to insufficient resources in the cluster
- **Initialized**: It means that all Init containers in the pod have started successfully
- **ContainersReady**: It indicates whether all containers in the pod are ready
   - **Ready**: PodReady means the pod is able to service requests and should be added to the load balancing pools for all matching services
   - **PodScheduled**: It represents the status of the scheduling process for this pod
   - **Unschedulable**: It means the scheduler cannot schedule the pod right now, maybe due to insufficient resources in the cluster
   - **Initialized**: It means that all Init containers in the pod have started successfully
   - **ContainersReady**: It indicates whether all containers in the pod are ready
- **Below is the information for PodStatus**
- **PodPhase**: Current condition of the pod
- **Conditions**: Details indicating why the pod is in this condition
- **HostIP**: IP address of the host to which pod is assigned
- **PodIp**: IP address allocated to the Pod
- **QosClass**: Assigned to the pod based on resource requirement
   - **PodPhase**: Current condition of the pod
   - **Conditions**: Details indicating why the pod is in this condition
   - **HostIP**: IP address of the host to which pod is assigned
   - **PodIp**: IP address allocated to the Pod
   - **QosClass**: Assigned to the pod based on resource requirement

![Upstream Controller](/img/edgecontroller/UpstreamController.png)
   ![Upstream Controller](/static/img/edgecontroller/UpstreamController.png)

## Controller Manager:
### Creates manager Interface and implements ConfigmapManager, LocationCache and podManager
### Creates manager interface and implements ConfigmapManager, LocationCache and podManager

- Manager defines the Interface of a manager, ConfigManager, Podmanager, secretmanager implements it
- Manages OnAdd, OnUpdate and OnDelete events which will be updated to the respective edge node from the K8s-Api-server
- 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
- **Below is the List of handlers created by controller Manager**
- **CommonResourceEventHandler**: NewcommonResourceEventHandler creates CommonResourceEventHandler used for Configmap and pod Manager
- **NewListWatch**: Creates a new ListWatch from the specified client resource namespace and field selector
- **NewSharedInformer**: Creates a new Instance for the Listwatcher
- Manager defines the interface of a manager, ConfigManager, Podmanager, secretmanager implements it
- Manages OnAdd, OnUpdate and OnDelete events which will be updated to the respective edge node from the K8s Api-server
- 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
- **Below is the List of handlers created by the controller Manager**
   - **CommonResourceEventHandler**: NewcommonResourceEventHandler creates CommonResourceEventHandler which is used for Configmap and pod Manager
   - **NewListWatch**: Creates a new ListWatch from the specified client resource namespace and field selector
   - **NewSharedInformer**: Creates a new Instance for the Listwatcher