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

Provide config to set global policies #481

Closed
mikz opened this issue Nov 14, 2017 · 3 comments · Fixed by #496
Closed

Provide config to set global policies #481

mikz opened this issue Nov 14, 2017 · 3 comments · Fixed by #496
Milestone

Comments

@mikz
Copy link
Contributor

mikz commented Nov 14, 2017

#450 implements policy chains that can be per service/global.

Service ones can be configured in service configuration.
Global ones have no configuration yet.

Ideally we could use lua-toml and provide nice human readable config in TOML. However due to a licensing issue (jonstoler/lua-toml#15) we can't use it yet. It is released under MIT license, so is compatible.

As an alternative we could try to extend the current JSON config with another global key for global configuration. But it is possible that would work only when loading configuration on boot.

It is possible to download configuration from network because we control the CLI and can make network calls. So the CLI start command can actually download the configuration to a temporary file.

Other proposals welcome.

@andrewdavidmackenzie
Copy link
Member

Any lua-yaml as a next-best option?

@mikz
Copy link
Contributor Author

mikz commented Nov 14, 2017

The yaml ones I found require extra library which seems unfortunate and would complicate the build process and manual installation.

@mikz
Copy link
Contributor Author

mikz commented Nov 16, 2017

So there is already a concept of an environment.

Those can be passed by CLI flag -e or THREESCALE_DEPLOYMENT_ENV env variable. The file can be overriden by APICAST_ENVIRONMENT_CONFIG env variable. This file is lua for now so you can do complicated stuff. This file has to return a table that is passed to the liquid template and used to render the nginx configuration. That means you can have the same nginx config and just some differences between the environments - like lua code cache, listening port, ...
The idea was that for example the production lua file could automatically detect number of cores from cgroups and use correct number of workers.

We could extend it on the policy list and add it there too. And start treating the environment as the global config file. We also could offer TOML version of that file that would be simple and more obvious than Lua.

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 a pull request may close this issue.

2 participants