-
Notifications
You must be signed in to change notification settings - Fork 6
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
Datadir automatic sync #126
Open
jemacchi
wants to merge
7
commits into
georchestra:main
Choose a base branch
from
jemacchi:datadir-automatic-sync
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
edevosc2c
requested changes
Jan 14, 2025
Hello jose, thank you for your contribution. I have reviewed your PR. Could you also please put a description to your PR so that other contributors understand what is it? You can also reference that it will close #75 |
hello @jemacchi, I just added a new review: #126 (comment) I haven't tested yet the code but hopefully today or tomorrow I'll. thanks :) |
edevosc2c
requested changes
Feb 6, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements the functional requirements mentioned in the ticket #75.
The goal is to automatically restart or reload the config of all the geOrchestra applications when there is a new commit in the geOrchestra datadir. That would allow for easier management of the datadir in test environments.
The implementation includes a new component (datadirsync) that is deployed with certain permissions to access the
kubernetes API.
This component implements python code that actively listens to a given git repository, in a certain branch, at defined time intervals looking for changes in the repository. If this happens, it then invokes through the k8s API the rollout of the deployments listed in the deploymentSuffixNameList variable considering the predefined namespace.
Since in the context of Georchestra the SDI components update the datadir at initialization (https://github.com/georchestra/helm-georchestra/blob/main/templates/_bootstrap-georchestra-datadir.tpl) the rollout of a component guarantees that when restarting, it reloads the necessary configuration information.
The template accepts the definition of the username and password of the user with which the checks are made on the git repository, or that an sshkey is used (in which case it will be included in the corresponding container).
For details of the logic, review the template/datadirsync-deployment.yaml file.
The python implementation that executes the repository status check actions is momentarily in the following repository/folder https://github.com/jemacchi/simple-git-rollout-operator/tree/main/operator .
Initially, it was expected to perhaps create a somewhat more robust solution, but since it is a component that is not expected to be used in production environments, a simpler solution was chosen, which makes use of the Kubernetes API natively, with a component that does not involve CRD installation, and that has the minimum and necessary RBAC permissions to perform the relevant action.