From b77368d53f59a317ed5279cca6fbba4e99ad9e49 Mon Sep 17 00:00:00 2001 From: Iwona Langer Date: Fri, 17 Nov 2023 16:21:12 +0100 Subject: [PATCH] Add diagrams made in drawio (#227) --- docs/user/01-manager.md | 36 +++---------------- docs/user/README.md | 2 +- .../assets/NC_watches_resources.drawio.svg | 4 +++ .../user/assets/Start_nats_manager.drawio.svg | 4 +++ .../reacting_to_nats_cr_changes.drawio.svg | 4 +++ .../reacting_to_resource_changes.drawio.svg | 4 +++ 6 files changed, 21 insertions(+), 33 deletions(-) create mode 100644 docs/user/assets/NC_watches_resources.drawio.svg create mode 100644 docs/user/assets/Start_nats_manager.drawio.svg create mode 100644 docs/user/assets/reacting_to_nats_cr_changes.drawio.svg create mode 100644 docs/user/assets/reacting_to_resource_changes.drawio.svg diff --git a/docs/user/01-manager.md b/docs/user/01-manager.md index dcdf469d..e7a8714c 100644 --- a/docs/user/01-manager.md +++ b/docs/user/01-manager.md @@ -14,51 +14,23 @@ Upon starting the NATS Manager, the controller (following the [Kubebuilder conce - Stateful Set (sts) - DestinationRule (dr, [Istio](https://istio.io)) - ```mermaid - graph LR - A(Start NATS manager) -->|Controller| D(Creates, watches & reconciles resources: cm, sc, sv, sts, dr) - ``` +![Start NATS manager](./assets/Start_nats_manager.drawio.svg) ### Reacting to NATS CR changes The NATS Manager reacts to changes of the NATS CR to adapt the resources mentioned above to the desired state. For details how to configure NATS using the CR, visit the [Configuration documentation](./02-configuration.md). - ```mermaid - graph LR - E(NATS CR changes)-->F(Reconciliation triggered)-->|Controller|G(Resources are adapted to reflect the changes) - ``` +![Reacting to NATS CR changes](./assets/reacting_to_nats_cr_changes.drawio.svg) ### Reacting to resource changes When resources are changed or deleted, the controller reacts by restoring the defaults according to the NATS CR. Thus, if you want to change the resources, you must edit the NATS CR; you cannot change the resources directly. - ```mermaid - graph LR - A(Resource changes/deleted)-->B(Reconciliation triggered)-->|Controller|C(Resources are restored according to their owner: NATS CR) - ``` +![Reacting to resource changes](assets/reacting_to_resource_changes.drawio.svg) -### Overview: Reconciliation Flow -The reconciliation flow is as follows: - - ```mermaid - graph TB - A([Start]) - -->B(Map configurations from NATS CR to overrides) - -->C(Render manifests from NATS Helm chart using Helm SDK) - -->D(Patch-apply rendered manifests to cluster using k8s client) - -->E(Checks status of StatefulSet for readiness) - -->F(Update NATS CR Status) - ``` ### Overview: NATS Manager watches resources - ```mermaid - graph TD - Con[NATS-Controller] -->|watches| cm[ConfigMap] - Con -->|watches| sc[Secret] - Con -->|watches| sv[Service] - Con -->|watches| sfs[StatefulSet] - Con -->|watches| dr[DestinationRule] - ``` + ![NM watches resources](assets/NC_watches_resources.drawio.svg) diff --git a/docs/user/README.md b/docs/user/README.md index f8bb73a2..a78436fc 100644 --- a/docs/user/README.md +++ b/docs/user/README.md @@ -1,4 +1,4 @@ -# NATS Manager Module +# NATS module This module ships the NATS Manager, which is responsible for managing the lifecycle of a [NATS JetStream](https://docs.nats.io/nats-concepts/jetstream) deployment. It observes the state of the NATS cluster and reconciles its state according to the desired state. diff --git a/docs/user/assets/NC_watches_resources.drawio.svg b/docs/user/assets/NC_watches_resources.drawio.svg new file mode 100644 index 00000000..bee812b9 --- /dev/null +++ b/docs/user/assets/NC_watches_resources.drawio.svg @@ -0,0 +1,4 @@ + + + +
watches
watches
watches
watches
watches
watches
watches
watches
NATS Controller
NATS Controller
ConfigMap
ConfigMap
Secret
Secret
Service
Service
watches
watches
StatefulSet
StatefulSet
DestinationRule
DestinationRule
Text is not SVG - cannot display
\ No newline at end of file diff --git a/docs/user/assets/Start_nats_manager.drawio.svg b/docs/user/assets/Start_nats_manager.drawio.svg new file mode 100644 index 00000000..79448905 --- /dev/null +++ b/docs/user/assets/Start_nats_manager.drawio.svg @@ -0,0 +1,4 @@ + + + +
starts
starts
starts
starts
NATS Manager
NATS Manager
creates,
watches,
and reconciles
creates,...
Controller
Controller
Resources:
cm
sc
sv
sts
dr
Resources:...
Resources:
cm
sc
sv
sts
dr
Resources:...
Text is not SVG - cannot display
\ No newline at end of file diff --git a/docs/user/assets/reacting_to_nats_cr_changes.drawio.svg b/docs/user/assets/reacting_to_nats_cr_changes.drawio.svg new file mode 100644 index 00000000..97523e33 --- /dev/null +++ b/docs/user/assets/reacting_to_nats_cr_changes.drawio.svg @@ -0,0 +1,4 @@ + + + +
triggers reconciliation
triggers reconciliation
Changed NATS CR
Changed NATS...
adapts to reflect the changes
adapts to reflect the changes
Controller
Controller
Resources:
cm
sc
sv
sts
dr
Resources:...
Resources:
cm
sc
sv
sts
dr
Resources:...
Text is not SVG - cannot display
\ No newline at end of file diff --git a/docs/user/assets/reacting_to_resource_changes.drawio.svg b/docs/user/assets/reacting_to_resource_changes.drawio.svg new file mode 100644 index 00000000..4ee86abb --- /dev/null +++ b/docs/user/assets/reacting_to_resource_changes.drawio.svg @@ -0,0 +1,4 @@ + + + +
trigger reconciliation
trigger reconciliation
Resources changed
or deleted
Resources cha...
Resources:
cm
sc
sv
sts
dr
Resources:...
restores
restores
Controller
Controller
Resources:
cm
sc
sv
sts
dr
Resources:...
Text is not SVG - cannot display
\ No newline at end of file