-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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: use etcd to store the JSON schema of APISIX, then the manager API can read it from etcd #2700
Comments
@nic-chen do you want to handle this job? |
OK, let me try. |
I think the main logic should be: When APISIX starts, read the key If the key does not exist or is empty, then read the JSON schema from APISIX and save to the ETCD key If the key already exists and is not empty, nothing will be done. APISIX provides a command line tool that can be used to manually update the JSON schema, like: What do you think ? cc @membphis @moonming @liuxiran @dabue @tokers @ShiningRush |
So all schemas are put inside a single JSON string here? BTW, have you consider the grayscale of APISIX itself? If the new version of APISIX has some incompatible changes for some schemas, once the schema is synced, all instances which shares the same ETCD cluster will be effected. So maybe versioning or other way like naming isolation is required. |
Is it necessary to automatically trigger schema synchronization when adding a new schema(e.g: add a new plugin) or modifying a schema, so that the consumer of the schema (e.g manager-api) can use the feature in a non-perceptible way? |
Thanks for suggestion, that's really helpful. So we could use key like And I think we need to manually maintain the schema version in both APISIX and what do you think ? |
What about using a separate key for each schema? just use
I am not sure whether the versioning is a good way to solve this, because APISIX should remember each schema's version that it needs. |
Thanks for suggestion. I have considered this before, but this will cause version problems, so I think it needs to be automatically generated if it does not exist, and the update should be triggered manually by the user. After solved the version issue, it could be automatically updated. |
I think separating them will increase the complexity, especially the version issue. |
JSON Schema version is a useful field, we need to store and compare it. Needs to show a warning message if the JSON schema version is different from APISIX version. |
Here is no need create version for schema, because the schema is build from APISIX, so schema version should same as APISIX.
Automation is very important to a product, we should not let users decide when to synchronize and when not to synchronize schema when it's effect scope is controllable( schema mismatch is will just effect dashboard not data plane), it will burden users. |
The first step can be done in the |
that is not a good idea, it is unsafe |
If we want to make sure the data plane doesn't modify etcd, another control plane component should be introduced to take over the uploading of jsonschema from APISIX, status collection or even the configuration delivery. |
yes, that is the right way. How about this? |
That's good. But the jsonschema source still in APIS |
then we go back to the old issue again.. |
@membphis Why it is unsafe, I can think of the worst result that is not compatible with manager-api, but this does not affect the normal works of the data plane, does it? |
We have to if we wanna the data plane reads etcd only. 😂 |
I gona to close this issue, we have discussed at maillist: https://lists.apache.org/thread.html/rb1c19fe9b6e51ede3b5aead122e2bcd4de6249f42b971eabfb8a79ac%40%3Cdev.apisix.apache.org%3E I'll create a new issue with the latest result. |
here is the discuss mail:
https://lists.apache.org/thread.html/rb1c19fe9b6e51ede3b5aead122e2bcd4de6249f42b971eabfb8a79ac%40%3Cdev.apisix.apache.org%3E
The text was updated successfully, but these errors were encountered: