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

feat(kuma-dp) retry connection to the DP/fetching bootstrap #982

Merged
merged 4 commits into from
Aug 21, 2020

Conversation

jakubdyszkiewicz
Copy link
Contributor

Summary

Adds retry for two situations

  • Connection to the Kuma API for Bootstrap API location. Connection problem may occur if CP is deployed at the same time as DP (ex. Ingress)
  • Bootstrap returns 404 for Dataplane definition. On K8S it means that CP is still in the process of Pod -> Dataplane conversion

Used https://github.com/sethvargo/go-retry library which has no additional dependencies. API is kind of meh, but the functionality is simple enough for our needs.

Issues resolved

Fix #968

Documentation

  • Internal only

Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
@jakubdyszkiewicz jakubdyszkiewicz requested a review from a team as a code owner August 17, 2020 13:53
@@ -122,7 +122,6 @@ func (cm *manager) startLeaderComponents(stop <-chan struct{}, errCh chan error)
closeLeaderCh()
},
})
log.Info("Starting leader election")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved this log to Postgres implementation. Otherwise on Kuma DP logs was starting leader election

})

if err != nil {
return nil, errors.Wrap(err, "could retrieve catalog")
Copy link
Contributor

Choose a reason for hiding this comment

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

could not ...

Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Copy link
Contributor

@nickolaev nickolaev left a comment

Choose a reason for hiding this comment

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

LGTM

@jakubdyszkiewicz jakubdyszkiewicz merged commit 3a4c807 into master Aug 21, 2020
@jakubdyszkiewicz jakubdyszkiewicz deleted the retry/kuma-dp branch August 21, 2020 07:24
nickolaev pushed a commit that referenced this pull request Oct 6, 2020
…982)

Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
# Conflicts:
#	app/kuma-dp/cmd/run.go

Signed-off-by: Nikolay Nikolaev <nikolay.nikolaev@konghq.com>
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.

Add retry for fetching bootstrap configuration
3 participants