mirror of
https://github.com/postmannen/ctrl.git
synced 2025-01-07 20:59:16 +00:00
update doc
This commit is contained in:
parent
2cdf406ec3
commit
595032fbb5
6 changed files with 301 additions and 8 deletions
171
doc/.$ctrl-drawings.drawio.bkp
Normal file
171
doc/.$ctrl-drawings.drawio.bkp
Normal file
|
@ -0,0 +1,171 @@
|
|||
<mxfile host="Electron" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/24.7.17 Chrome/128.0.6613.36 Electron/32.0.1 Safari/537.36" version="24.7.17" pages="2">
|
||||
<diagram name="core-messaging" id="nlSWXV44TWduW5NrCRzE">
|
||||
<mxGraphModel dx="812" dy="603" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0" />
|
||||
<mxCell id="1" parent="0" />
|
||||
<mxCell id="JB4UHpmZ01gNuVjmXd_b-1" value="node<br>central" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="570" y="50" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="JB4UHpmZ01gNuVjmXd_b-3" value="node<br>operator" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="230" y="50" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="JB4UHpmZ01gNuVjmXd_b-4" value="node<br>linux1" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="175" y="410" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="JB4UHpmZ01gNuVjmXd_b-5" value="node<br>linux2" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="410" y="410" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="JB4UHpmZ01gNuVjmXd_b-6" value="node<br>linux3" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="660" y="410" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="JB4UHpmZ01gNuVjmXd_b-9" value="NATS Server" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="410" y="220" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="JB4UHpmZ01gNuVjmXd_b-10" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="295" y="120" as="sourcePoint" />
|
||||
<mxPoint x="400" y="220" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="JB4UHpmZ01gNuVjmXd_b-12" value="command<br>Upgrade all servers,<br>and restart" style="html=1;verticalLabelPosition=bottom;align=center;labelBackgroundColor=#7EA6E0;verticalAlign=top;strokeWidth=2;strokeColor=#0080F0;shadow=0;dashed=0;shape=mxgraph.ios7.icons.envelope_(message);" vertex="1" parent="1">
|
||||
<mxGeometry x="305" y="120" width="30" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="JB4UHpmZ01gNuVjmXd_b-13" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="410" y="290" as="sourcePoint" />
|
||||
<mxPoint x="250" y="400" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="JB4UHpmZ01gNuVjmXd_b-14" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="490" y="290" as="sourcePoint" />
|
||||
<mxPoint x="490" y="400" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="JB4UHpmZ01gNuVjmXd_b-15" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="530" y="290" as="sourcePoint" />
|
||||
<mxPoint x="730" y="400" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="JB4UHpmZ01gNuVjmXd_b-17" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="360" y="80" as="sourcePoint" />
|
||||
<mxPoint x="560" y="80" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="JB4UHpmZ01gNuVjmXd_b-18" value="to audit log" style="html=1;verticalLabelPosition=bottom;align=center;labelBackgroundColor=#7EA6E0;verticalAlign=top;strokeWidth=2;strokeColor=#0080F0;shadow=0;dashed=0;shape=mxgraph.ios7.icons.envelope_(message);" vertex="1" parent="1">
|
||||
<mxGeometry x="440" y="40" width="30" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="JB4UHpmZ01gNuVjmXd_b-19" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="210" y="380" as="sourcePoint" />
|
||||
<mxPoint x="390" y="260" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="JB4UHpmZ01gNuVjmXd_b-20" value="result" style="html=1;verticalLabelPosition=bottom;align=center;labelBackgroundColor=#7EA6E0;verticalAlign=top;strokeWidth=2;strokeColor=#0080F0;shadow=0;dashed=0;shape=mxgraph.ios7.icons.envelope_(message);" vertex="1" parent="1">
|
||||
<mxGeometry x="280" y="280" width="25" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="JB4UHpmZ01gNuVjmXd_b-21" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="469" y="400" as="sourcePoint" />
|
||||
<mxPoint x="469" y="290" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="JB4UHpmZ01gNuVjmXd_b-23" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="760" y="380" as="sourcePoint" />
|
||||
<mxPoint x="550" y="260" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="JB4UHpmZ01gNuVjmXd_b-28" value="result" style="html=1;verticalLabelPosition=bottom;align=center;labelBackgroundColor=#7EA6E0;verticalAlign=top;strokeWidth=2;strokeColor=#0080F0;shadow=0;dashed=0;shape=mxgraph.ios7.icons.envelope_(message);" vertex="1" parent="1">
|
||||
<mxGeometry x="457.5" y="320" width="25" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="JB4UHpmZ01gNuVjmXd_b-29" value="result" style="html=1;verticalLabelPosition=bottom;align=center;labelBackgroundColor=#7EA6E0;verticalAlign=top;strokeWidth=2;strokeColor=#0080F0;shadow=0;dashed=0;shape=mxgraph.ios7.icons.envelope_(message);" vertex="1" parent="1">
|
||||
<mxGeometry x="640" y="270" width="25" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="JB4UHpmZ01gNuVjmXd_b-34" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="450" y="190" as="sourcePoint" />
|
||||
<mxPoint x="370" y="110" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="JB4UHpmZ01gNuVjmXd_b-35" value="result" style="html=1;verticalLabelPosition=bottom;align=center;labelBackgroundColor=#7EA6E0;verticalAlign=top;strokeWidth=2;strokeColor=#0080F0;shadow=0;dashed=0;shape=mxgraph.ios7.icons.envelope_(message);" vertex="1" parent="1">
|
||||
<mxGeometry x="410" y="120" width="25" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
<diagram id="qFRR07fG-FmuFiP5yuTj" name="usecase-prometheus-collector">
|
||||
<mxGraphModel dx="812" dy="603" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
|
||||
<root>
|
||||
<mxCell id="0" />
|
||||
<mxCell id="1" parent="0" />
|
||||
<mxCell id="ecZOID4O2T0Gi5I6YuLK-1" value="node<br>central" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="515" y="80" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="ecZOID4O2T0Gi5I6YuLK-2" value="node<br>metrics" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="175" y="80" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="ecZOID4O2T0Gi5I6YuLK-3" value="node<br>linux1" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="120" y="440" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="ecZOID4O2T0Gi5I6YuLK-4" value="node<br>linux2" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="355" y="440" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="ecZOID4O2T0Gi5I6YuLK-5" value="node<br>linux3" style="rounded=0;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="605" y="440" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="ecZOID4O2T0Gi5I6YuLK-6" value="NATS Server" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="1">
|
||||
<mxGeometry x="355" y="250" width="120" height="60" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="ecZOID4O2T0Gi5I6YuLK-12" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="305" y="110" as="sourcePoint" />
|
||||
<mxPoint x="505" y="110" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="ecZOID4O2T0Gi5I6YuLK-13" value="to audit log" style="html=1;verticalLabelPosition=bottom;align=center;labelBackgroundColor=#7EA6E0;verticalAlign=top;strokeWidth=2;strokeColor=#0080F0;shadow=0;dashed=0;shape=mxgraph.ios7.icons.envelope_(message);" vertex="1" parent="1">
|
||||
<mxGeometry x="385" y="70" width="30" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="ecZOID4O2T0Gi5I6YuLK-14" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="170" y="420" as="sourcePoint" />
|
||||
<mxPoint x="340" y="280" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="ecZOID4O2T0Gi5I6YuLK-15" value="metric data" style="html=1;verticalLabelPosition=bottom;align=center;labelBackgroundColor=#7EA6E0;verticalAlign=top;strokeWidth=2;strokeColor=#0080F0;shadow=0;dashed=0;shape=mxgraph.ios7.icons.envelope_(message);" vertex="1" parent="1">
|
||||
<mxGeometry x="230" y="310" width="25" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="ecZOID4O2T0Gi5I6YuLK-16" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="414" y="430" as="sourcePoint" />
|
||||
<mxPoint x="414" y="320" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="ecZOID4O2T0Gi5I6YuLK-17" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="650" y="420" as="sourcePoint" />
|
||||
<mxPoint x="495" y="280" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="ecZOID4O2T0Gi5I6YuLK-18" value="metric data" style="html=1;verticalLabelPosition=bottom;align=center;labelBackgroundColor=#7EA6E0;verticalAlign=top;strokeWidth=2;strokeColor=#0080F0;shadow=0;dashed=0;shape=mxgraph.ios7.icons.envelope_(message);" vertex="1" parent="1">
|
||||
<mxGeometry x="402.5" y="350" width="25" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="ecZOID4O2T0Gi5I6YuLK-19" value="metric data" style="html=1;verticalLabelPosition=bottom;align=center;labelBackgroundColor=#7EA6E0;verticalAlign=top;strokeWidth=2;strokeColor=#0080F0;shadow=0;dashed=0;shape=mxgraph.ios7.icons.envelope_(message);" vertex="1" parent="1">
|
||||
<mxGeometry x="562.5" y="310" width="25" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
<mxCell id="ecZOID4O2T0Gi5I6YuLK-20" value="" style="endArrow=classic;html=1;rounded=0;" edge="1" parent="1">
|
||||
<mxGeometry width="50" height="50" relative="1" as="geometry">
|
||||
<mxPoint x="395" y="220" as="sourcePoint" />
|
||||
<mxPoint x="315" y="140" as="targetPoint" />
|
||||
</mxGeometry>
|
||||
</mxCell>
|
||||
<mxCell id="ecZOID4O2T0Gi5I6YuLK-21" value="result" style="html=1;verticalLabelPosition=bottom;align=center;labelBackgroundColor=#7EA6E0;verticalAlign=top;strokeWidth=2;strokeColor=#0080F0;shadow=0;dashed=0;shape=mxgraph.ios7.icons.envelope_(message);" vertex="1" parent="1">
|
||||
<mxGeometry x="355" y="150" width="25" height="30" as="geometry" />
|
||||
</mxCell>
|
||||
</root>
|
||||
</mxGraphModel>
|
||||
</diagram>
|
||||
</mxfile>
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 132 KiB |
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,11 @@
|
|||
# Core overview
|
||||
|
||||
This is just a quick introduction to the core concepts of ctrl. Details can be found by reading further in the **Core ctrl** section.
|
||||
|
||||
## Concept
|
||||
|
||||
In ctrl all nodes are treated equally, and there is no concept of client/server. There are just nodes that can send messages to other nodes, and the messages contains commands of what to do on the node that receives the message.
|
||||
|
||||
<style>
|
||||
img {
|
||||
background-color: #FFFFFF;
|
||||
|
@ -9,3 +15,14 @@ img {
|
|||
<body>
|
||||
<p align="center"><img src="https://github.com/postmannen/ctrl/blob/main/doc/core-messaging.svg?raw=true" /></p>
|
||||
</body>
|
||||
|
||||
A message can be sent from a node to one, many, groups or all nodes with a command to execute, and the result of when the command is done will be sent back to where the message originated.
|
||||
|
||||
## Central
|
||||
|
||||
There should be at least one node acting as the **central** in each environment. The central node will have functionality like:
|
||||
|
||||
- Audit logging of all commands sent and executed on nodes.
|
||||
- Handling and distributing keys for signing messages.
|
||||
- Handling and distributing Access Lists (ACL) for authorizing messages.
|
||||
- General error logging.
|
||||
|
|
|
@ -2,6 +2,12 @@
|
|||
|
||||
ctrl can be used to collect collect metrics from various systems. It can for example scrape/read some defined metrics with one node, and deliver the result to another node where you can expose the metrics directly using ctrl's builtin http server, or you could for example inject the metrics data to some database if that is desired. It is totally up to you.
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<p align="center"><img src="https://github.com/postmannen/ctrl/blob/main/doc/usecase-prometheus-collector.svg?raw=true" /></p>
|
||||
</body>
|
||||
|
||||
The example that follows will scrape prometheus metrics with two ctrl nodes, deliver them to a third node called **metrics**, and expose them with the builtin http server. Prometheus can then be used to read all the metrics from the various nodes on the **metrics** node.
|
||||
|
||||
Before you start, make sure to read the **User Guides** section for how to start up a NATS broker, and for general information about setting up ctrl.
|
||||
|
|
4
doc/usecase-prometheus-collector.svg
Normal file
4
doc/usecase-prometheus-collector.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 161 KiB |
Loading…
Reference in a new issue