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

chore(kuma-dp) refactor to components #642

Merged
merged 1 commit into from
Mar 24, 2020

Conversation

jakubdyszkiewicz
Copy link
Contributor

Summary

There is a concept in Kuma CP called Components. Component can be a grpcServer, httpServer, some background process etc. (This concept is borrowed from K8S codebase). When CP starts, it register several components into Manager and Manager starts all the components.

Since soon we will be introducing another server into Kuma DP, I think we should reuse Component concept in Kuma DP.

I made slight modification to our Component/Manager interfaces to get rid of K8S imports, therefore the need of this small kubeComponentManager struct. Otherwise we would be embedding K8S code into Kuma DP. DP should be as lightweight as possible.

@jakubdyszkiewicz jakubdyszkiewicz requested review from lobkovilya and a team March 24, 2020 12:48
go func() {
defer close(logServerErr)
if err := server.Start(cfg.Dataplane); err != nil {
runLog.Error(err, "problem running Access Log server")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you eliminate that log line, it looks useful for troubleshooting process

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's now handled by: runLog.Error(err, "error while running Kuma DP")
If any component returns an error the componentMgr.Start returns an error.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but it will return err := s.server.Serve(lis) which is actually a grpc error. So we won't understand which exactly component failed to start.

go func() {
defer close(dataplaneErr)
if err := dataplane.Run(core.SetupSignalHandler()); err != nil {
runLog.Error(err, "problem running Dataplane (Envoy)")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And that one

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's now handled by: runLog.Error(err, "error while running Kuma DP")
If any component returns an error the componentMgr.Start returns an error.

@jakubdyszkiewicz jakubdyszkiewicz merged commit 8165509 into master Mar 24, 2020
@devadvocado devadvocado deleted the chore/refactor-components-kuma-dp branch March 30, 2020 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants