Allow reading config files from either a GCP bucket or a local filesystem
Purpose
Enhance the Config server software and update current cloud architecture and gitOps chain, so that it can read resources from either a GCP bucket or a local filesystem. This eliminates the need to manually copy resources from the GCP bucket to the Config server container file system and to manually restart the Config server after updates.
Context
Config server responds to HTTP GET requests on 3 urls /^/assets//, /^/configs//, /^/i18n// and returns resource content that matches files path names under a data folder.
Data folder is populated at server’s boot time by a script launched by an init container that copies resources from a GCP bucket.
Config resources (assets, configs, i18n) are copied via the execution of a gitOps chain from a gitlab repository to the GCP bucket.
When new files are copied to the GCP bucket, Config server must be restarted to get them locally.
The new feature will remove the need to copy resources from the GCP bucket to the Config server container file system, thus eliminating the need to restart the Config server after updates.
GCP buckets are used only for cloud based deployments, on premise deployments must still be able to run the Config docker container with a mount point from local filesystem to a container’s file system data folder.
Todo
Reading resources from either a GCP bucket or a local filesystem, requires introducing a new DataProvider software layer that will allow switching, at deployment time, between one of the providers. DataProvider will be implemented by either a GCPBucketProvider or a FileSystemProvider. We may add later other providers to read for example data from Minio (out of this scope).
Tasks:
-
Update existing code to DataProvider -
Implement GCPBucketProvider -
Implement FileSystemProvider -
Add new env variables to setup DataProvider -
Write tests for both providers -
Update GKE deployments -
Update gitOps scripts -
Update documentation -
Unit Tests - test coverage of 70% at least