Config Server is a Cross-Platform key/value store which dynamically converts yaml files into rest services.
Actually it is up to you. schedules/get-repo.ps1 file is responsible from getting yamls from remote and by default, config server assumes that yaml files are kept in a git repository.
But it is possible to add custom logic to get/sync yaml files or completely disabling and working on existing local yaml files by changing schedules/get-repo.ps1.
Assume that you have 2 yaml files test1.yaml and test2.yaml;
nested:
array:
- this
- is
- an
myKey: world1
myKey2: myValue2
Config server will convert all keys in all yaml files to the following endpoints:
There is no prerequisites for
cnsn/config-serverbase image, all requirements are already installed inside docker image.
If you want to run config-server out of container, first thing you need is Powershell Core (PS > 6.0). Also
gitshould be installed and finally config-server should be able to reach repos defined in Powershell Gallery. When you startconfig-server.ps1for the first time, following modules will be installed from Powershell Gallery if they are not installed already:
If you want to install them manually, you can use following commands:
Install-Module -Name "powershell-yaml" -RequiredVersion 0.4.1 -Force -Scope CurrentUser
Install-Module -Name "pode" -RequiredVersion 1.6.1 -Force -Scope CurrentUser
Install-Module -Name "pscache" -RequiredVersion 0.1.0 -Force -Scope CurrentUser
Config server will use environment variables during server startup to configure itself. They are:
repo: Remote git repo address that config server will clone and pull periodically. Default: https://github.com/haidouks/configsPodePort: Port that will config server will be listening. Default: 8085ThreadCount: Dedicated thread count for all routes. Default: 5VerbosePreference: Enable verbose logging. Default: SilentlyContinueenableAuthentation: Enable authentication. Default: FalseauthenticatedRoutes: List of routes that will be authenticated. Default: NulldefaultAuthToken: Bearer token for default authencation type. Default:QweAsdZxc123Example 1: Quick start
docker run -d -p 8085:8085 cnsn/config-server:latest
Now browse http://localhost:8085/test/myKey:
test is the name of yaml file in default source repository: https://github.com/haidouks/configsmyKey is a key in test.yamlResponse should see something like {"value":"world1"} which is the value of key myKey
Example 2: Configure variables
docker run -d -p 8085:8085 \
-e VerbosePreference=Continue \
-e ThreadCount=10 \
-e repo=https://github.com/haidouks/configs \
cnsn/config-server
Example 3: Authenticate some routes
docker run -d -p 8085:8085 \
-e repo=https://github.com/haidouks/configs \
-e enableAuthentation=true \
-e authenticatedRoutes=test/*:DefaultAuth \
-e defaultAuthToken=Qweasd123 \
cnsn/config-server
Content type
Image
Digest
Size
71.9 MB
Last updated
over 5 years ago
docker pull cnsn/config-server