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

fix(kuma-cp) signing token in multizone #1007

Merged
merged 2 commits into from
Sep 7, 2020

Conversation

jakubdyszkiewicz
Copy link
Contributor

Dataplane Token is an identity that we give to Dataplanes and verify it on the CP on Universal deployments. On K8S we use service account tokens. Dataplane Token is a JWT token signed by Signing Token that is generated when CP starts.

With multizone setup when Global is on K8S and you connect Remote Universal, KDS syncs all the secrets from Global to Remote. Since Global is a centralized single source of truth for everything other than Dataplanes, if Secret is not available on Global, it will be removed from the Remote. What happened is that we were generating token on Remote but not on Global so it was removed from Remote. This PR fixes this behavior.

This time we generate Signing Key with a multizone setup only on Global but in all environments. Even if Global is on K8S, we don't know when the user will connect Universal Remote and there will be a need to generate DP tokens. We don't generate token on the Remote anymore. From now, to deploy app on Remote Universal, you need to first connect to Global to sync Signing Key, otherwise you won't be able to verify Token that DP presents.

Additionally, you should be able to generate Tokens on both Global and Remote. The Global-Remote design assumes that you can spin up and down Dataplanes without Global. There might be a case that CI that deploys the app generates token beforehand therefore there should be a way to generate it also on the Remote.

I added a simple E2E test to check that if I have Global on K8S and Remote Universal I can deploy 2 apps.

Documentation

  • TODO with DP improvements.

Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
@jakubdyszkiewicz jakubdyszkiewicz requested a review from a team as a code owner September 4, 2020 11:32
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
@jakubdyszkiewicz jakubdyszkiewicz merged commit dc95cf5 into master Sep 7, 2020
@jakubdyszkiewicz jakubdyszkiewicz deleted the fix/signing-token-sync branch September 7, 2020 08:52
nickolaev pushed a commit that referenced this pull request Oct 1, 2020
Signed-off-by: Jakub Dyszkiewicz <jakub.dyszkiewicz@gmail.com>
# Conflicts:
#	pkg/sds/auth/universal/auth_test.go
#	pkg/tokens/builtin/issuer/issuer.go
#	test/framework/universal_cluster.go
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.

2 participants