CONFIGSERVICE
This core service manages profile-related and other configuration files using git as storage backend.
Characteristics
Service Name | configservice |
---|---|
Port Range | 7281 |
Profiles | prod,cloud,native |
Helm Chart | yuuvis |
Function
Most of the yuuvis® Momentum core services are configured via profiles and corresponding configuration files. Following the basic concepts of Spring Boot, the configuration files are stored on a git server and are managed via the CONFIGSERVICE.
>> Configuring Services using Profiles
The CONFIGSERVICE cannot start without an active connection to the git server.
At runtime, the CONFIGSERVICE applies all changes to configuration files to its local resources first. At regular intervals of 5 minutes, the remote resources on the git server are synchronized according to the following procedure:
- All changes in the local resources applied during the last five minutes are summarized in one single commit.
- A git pull request with
THEIRS
merge policy is used to introduce changes made directly in the remote resources into the local resources.
Note: It is thus possible to overwrite changes that are applied to the local resources (e.g., via yuuvis® Momentum endpoints) by applying changes directly to the remote repository. However, those changes are NOT visible before the regular synchronization. - The commit and the merge result are published via a single push request.
This procedure of collecting and summarizing changes reduces the number of commits that have to be managed by the CONFIGSERVICE in case of a high frequency of change requests.
Additionally, as of 2022 Summer, it is possible to synchronize the local resources of the CONFIGSERVICE and the remote resources on the git server via the endpoint POST
<host>:<port_of_configservice>/manage/refresh
at any time. This synchronization is additional and independent of the automated synchronization every 5 minutes.
>> POST /configservice/manage/refresh
Note: In case multiple instances of the CONFIGSERVICE are running, the synchronization of the individual local resources is done at the regular intervals of 5 minutes as well. Thus, requests for resources that have been modified less than 5 minutes ago might lead to the retrieval of a deprecated version of those resources. Resources created less than 5 minutes ago might be not available.
In the Kubernetes environment, each instance of the CONFIGSERVICE additionally stores the resources in a separate persistent volume at /tmp/configservice
. In the default configuration, changes in those resources are used for the service initialization. I.e., changes that are not yet included in the commit are calculated via git
diff
and considered during the synchronization procedure described above.
Configuration
Per default, the CONFIGSERVICE uses the persistent volume at /tmp/configservice
for initialization during a restart. Alternatively, the CONFIGSERVICE can delete and recreate the directory /tmp/configservice
by cloning the remote resources during the initialization. This behavior can be applied by one of the following configurations:
- Set
resume-from-local-git:
false
in theapplication-prod.yml
configuration file. - Set the environment variable
RESUME-FROM-LOCAL-GIT=false
in the Kubernetes deployment of the CONFIGSERVICE (default istrue
).