|
1 | 1 | ### How it works
|
2 | 2 |
|
3 |
| - - User creating custom resource of `Kind: LightrunJavaAgent` |
| 3 | + - The User begins by creating a custom resource of `Kind: LightrunJavaAgent` |
4 | 4 | [Example](../config/samples/agents_v1beta_lightrunjavaagent.yaml)
|
5 | 5 | [Detailed explanation of CR fields](custom_resource.md)
|
6 |
| - - Controller is receiving all updates about all CRs(custom resources)`LightrunJavaAgent` across all the cluster (or specific namespaces). Every event triggering reconcile loop of the controller. You can find logic of this loop [here](reconcile_loop.excalidraw.png) |
7 |
| - - When triggered it is doing several actions: |
| 6 | + - The Controller receives all updates about all CRs (custom resources) of kind `LightrunJavaAgent` across all the cluster or specific namespaces |
| 7 | + (subject to how it's been installed). |
| 8 | + Every event related to these CRs triggers the reconcile loop of the controller. You can find logic of this loop [here](reconcile_loop.excalidraw.png) |
| 9 | + - When triggered, the controller performs several actions: |
8 | 10 | - Check if it has access to deployment
|
9 |
| - - Fetch data from the specified in CR secret |
| 11 | + - Fetch data from the CR secret |
10 | 12 | - Create config map with agent config from CR data
|
11 |
| - - Patching deployment: |
| 13 | + - Patch the deployment: |
12 | 14 | - insert init container
|
13 | 15 | - add volume
|
14 |
| - - map that volume to specified container |
15 |
| - - add/update specified ENV variable in order to let Java know where agent is placed |
16 |
| - - After deployment is being patched, k8s will `recreate all the pods` in the deployment. New Pods will be using Lightrun agent from their start |
17 |
| - - If user deleting `LightrunJavaAgent` CR, controller will rollback all the changes to deployment. This will trigger `recreation of all pods` again |
| 16 | + - map that volume to the specified container |
| 17 | + - add/update specified ENV variable in order to let Java know where agent files are found (the mapped volume) |
| 18 | + - After deployment is patched, k8s will `recreate all the pods` in the deployment. New Pods will be initialized with the Lightrun agent |
| 19 | + - If user deletes the `LightrunJavaAgent` CR, the Controller will roll back all the changes to deployment. This will trigger `recreation of all pods` again |
18 | 20 | - [High level diagram](resource_relations.excalidraw.png) of resources created/edited by the operator
|
0 commit comments