-
Notifications
You must be signed in to change notification settings - Fork 168
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
Add object search controller #190
Add object search controller #190
Conversation
objectSearchUserWorker = "userworker" | ||
objectSearchTrackingWorker = "trackingworker" | ||
objectSearchReidWorker = "reidworker" | ||
reidPort = 9378 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it means reid service port?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I changed it to reidServicePort.
c.enqueueController(service, immediate) | ||
} | ||
|
||
//When a deployment is created, enqueue the controller that manages it and update it's expectations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leave a space after '//'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
c.enqueueByDeployment(deployment, true) | ||
} | ||
|
||
//deleteDeployment enqueues the ObjectSearchService obj When a deleteDeployment is deleted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same problem
var reason string | ||
var message string | ||
|
||
if podFailed > 0 || deploymentFailed > 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might can use switch-case instead of if-else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to switch-case.
"github.com/kubeedge/sedna/pkg/globalmanager/runtime" | ||
) | ||
|
||
// func (c *Controller) syncToEdge(eventType watch.EventType, obj interface{}) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove these comment codes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed and add TODO tag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look like commented code not removed
// return c.sendToEdgeFunc(nodeName, eventType, joint) | ||
// } | ||
|
||
func (c *Controller) SetDownstreamSendFunc(f runtime.DownstreamSendFunc) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some comment or TODO to explain that no need sync the object search service info to edge nodes(i.e. Local Controller).
*/ | ||
|
||
// updateFromEdge syncs the edge updates to k8s | ||
func (c *Controller) updateFromEdge(name, namespace, operation string, content []byte) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updateFromEdge
can not be called since no update from LC.
Recommended that remove this untested implemention, and add a TODO comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed and add TODO comment.
@@ -170,6 +180,107 @@ func CreatePodWithTemplate(client kubernetes.Interface, object CommonInterface, | |||
return createdPod, nil | |||
} | |||
|
|||
//CreateEdgeMeshService creates a kubeedge edgemesh service for an object, and returns an edgemesh service URL. | |||
//Since edgemesh can realize Cross-Edge-Cloud communication, the service can be created both on the cloud or edge side. | |||
func CreateEdgeMeshService(kubeClient kubernetes.Interface, object CommonInterface, workerType string, inputPort int32) (string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference between CreateEdgeMeshService and CreateKubernetesService? I can't see it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are three main differences:
-
ObjectMeta uses Name instead of GenerateName because it relates to the URL returned.
-
A fixed format URL needs to be returned.
-
Port Name is required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. You can extend CreateKubernetesService to support these differences.
pkg/globalmanager/runtime/worker.go
Outdated
@@ -170,6 +180,107 @@ func CreatePodWithTemplate(client kubernetes.Interface, object CommonInterface, | |||
return createdPod, nil | |||
} | |||
|
|||
//CreateEdgeMeshService creates a kubeedge edgemesh service for an object, and returns an edgemesh service URL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add extra a space after //
, same with other places.
//CreateEdgeMeshService creates a kubeedge edgemesh service for an object, and returns an edgemesh service URL. | |
// CreateEdgeMeshService creates a kubeedge edgemesh service for an object, and returns an edgemesh service URL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
Signed-off-by: EnfangCui <[email protected]>
b6dbaf4
to
76c79d1
Compare
Signed-off-by: Yutong Wang <[email protected]>
Signed-off-by: HenryChou <[email protected]>
Signed-off-by: DanLiu <[email protected]>
394de29
to
e25fe23
Compare
…troller Signed-off-by: ShiXiaohou <[email protected]>
e25fe23
to
ff28a1e
Compare
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: llhuii The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The user worker and ReID workers can be created on both cloud and edge. ( EdgeMesh v1.8 supports cross edge-cloud communication.)