The following are some of my thoughts, I hope to discuss with you. First of all, I want to correct the second step of the plan,
Should change `apisix automatically synchronizes the custom plugin lua files to etcd.` to `apisix automatically synchronizes the custom plugin from etcd.` A rough process should look like this: 1. user modify some lua plugins through dashboard; || || \/ 2. dashboard sync lua plugins to etcd through manager-api; || || \/ 3. apisix(DP) automatically synchronizes the custom plugin from etcd. And do not need to write to lua file. Now, Let's add some version control for lua plugins with the concept of gitops, which will be executed between step 1 and step 2 above. A GitOps process is a bit like we usually submit PRs, and with some conventions of branch management model , we can implement a simple CI/CD. For example, suppose we have two branches dev and main, 1. write/modify plugins in dev branch 2. After completing the normal test, submit the PR to the main branch to trigger the CI test 3. After CI is done successfully, the code is merged into the main branch 4. The dashboard monitors the changes of the main branch and pushes the changed lua files to etcd This may result in some changes to the dashboard and APISIX, but I think it is worth it. The way of using GitOps has the following advantages: 1. When encountering problems, quickly roll back to the last stable version 2. Contribute to multi-cluster management 3. Since plugin files may be independent as a separate warehouse, and even help us realize the plug-in market Of course, we do face some complex plug-in scenarios, for example, plug-ins that need to modify sharedict or those plugins which need to patch APISIX / OpenResty itself. I suggest that this kind of plug-in is special, so you don't need to support it at first. Only supports single lua files. Zexuan Luo <[email protected]> 于2021年3月3日周三 上午10:09写道: > Some plugins contain changes across multiple files and even need to > patch APISIX / OpenResty itself. The solution should be able to handle > it. > > Zexuan Luo <[email protected]> 于2021年3月3日周三 上午10:04写道: > > > > Please explain how to use GitOps to update the custom plugins via > dashboard. > > > > Yi Sun <[email protected]> 于2021年3月3日周三 上午9:44写道: > > > > > > 1. Is it possible to have the user sync the etcd lua file before > re-package? > > > 2. We can probably use other tools like GitOps to manage custom > plugins? > > > > > > Thanks. > > > > > > Zexuan Luo <[email protected]> 于2021年3月2日周二 下午3:47写道: > > > > > > > Some users who write their custom plugins will re-package APISIX by > > > > themselves. Sync the Lua files to etcd might not be a good choice for > > > > them. > > > > And etcd is not suitable to manage files. > > > > > > > > 孙毅 <[email protected]> 于2021年3月2日周二 下午3:38写道: > > > > > > > > > > Hello, devs, > > > > > > > > > > The current process for users who want to use custom plugins. > > > > > 1. configure the custom plugin according to the apisix > specification: > > > > > https://github.com/apache/apisix/blob/ > > > > > master/docs/en/latest/plugin-develop.md > > > > > 2. export the apisix jsonschema file. > > > > > 3. Manually import the exported jsonshcema file into the > apisix-dashboard > > > > > conf directory. 4. > > > > > 4. restart manager-api. > > > > > > > > > > Disadvantage: The process is too tedious and requires manual > copying > > > > which > > > > > is prone to errors > > > > > > > > > > Improvements: > > > > > According to the design architecture of apisix and security > > > > considerations, > > > > > apisix does not allow direct modification of ETCD. > > > > > 1. the user synchronizes the custom plugin lua files to etcd > through the > > > > > dashboard interface or by calling the interface. > > > > > 2. apisix automatically synchronizes the custom plugin lua files > to etcd. > > > > > Advantage: greatly reduces the difficulty of using custom plugins, > no > > > > > manual synchronization process > > > > > Disadvantages: > > > > > 1.Only supports single lua files > > > > > 2. Share dict is not supported > > > > > > > > > > what do you think? > > > > > > > > > > Thanks. > > > > >
