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) override bootstrap version #1412

Merged
merged 4 commits into from
Jan 14, 2021

Conversation

jakubdyszkiewicz
Copy link
Contributor

Summary

This PR introduces an option to override Bootstrap Version on Kuma DP side.

The regular case is that Kuma CP decides which Bootstrap Version (and API Version) it will serve to the DP.

Envoy 1.17 technically drops V2 support, but you can still use it when you specify explicitly --bootstrap-verison 2 as CLI args to Envoy.
Kuma DP did not know about Bootstrap version so far, so I added extra header that we return from the Kuma CP so Kuma DP can pass the version to Envoy.

Additionally, there are some cases when you would like to override Bootstrap Version for one Kuma DP (for example to V3, while keeping the default Bootstrap to V2 for all other DPs). Those use cases are

  1. Testing. When testing, it's usefull to just switch back and forth between versions without restarting CP.
  2. Migrations. When running on prod, you may want to check only one DP on V3 that everything is fine while keeping every other on V2.

Documentation

  • This can be included in upgrade guide as a tip when we will change V2 -> V3 by default.

Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
@jakubdyszkiewicz jakubdyszkiewicz requested a review from a team as a code owner January 12, 2021 18:10
…de-bootstrap-ver

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.

Some nits, otherwise LGTM

@@ -64,6 +64,7 @@ func (b *BootstrapHandler) Handle(resp http.ResponseWriter, req *http.Request) {

resp.WriteHeader(http.StatusOK)
resp.Header().Set("content-type", "text/x-yaml")
resp.Header().Set(types.BootstrapVersionHeader, string(version))
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a better approach would be to convert this to a GRPC service and gave a dedicated field instead of the header. But I guess we can live with it as it is proposed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

gRPC is overkill in my opionion. Simple REST service with JSON with fields "version" and "bootstrap config" is probably a better idea of those two, but this brings even more problems with backward compatibility, so unless we need more control I'd stick to this for now.

app/kuma-dp/pkg/dataplane/envoy/envoy.go Show resolved Hide resolved
pkg/xds/bootstrap/generator.go Outdated Show resolved Hide resolved
pkg/xds/bootstrap/handler.go Outdated Show resolved Hide resolved
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
@jakubdyszkiewicz jakubdyszkiewicz merged commit 118e86f into master Jan 14, 2021
@jakubdyszkiewicz jakubdyszkiewicz deleted the feat/kuma-dp-override-bootstrap-ver branch January 14, 2021 11:08
mergify bot pushed a commit that referenced this pull request Jan 14, 2021
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
(cherry picked from commit 118e86f)

# Conflicts:
#	pkg/sds/server/v3/server_test.go
#	pkg/xds/bootstrap/generator.go
jakubdyszkiewicz added a commit that referenced this pull request Jan 14, 2021
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
jakubdyszkiewicz pushed a commit that referenced this pull request Jan 15, 2021
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
austince pushed a commit to hvydya/kuma that referenced this pull request Jan 17, 2021
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.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.

None yet

3 participants