fix(kuma-cp) signing token in multizone #1007
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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