Documentation tooling
Requirements for tools and documentation
- Open source tooling
- Editable with
vim
,emacs
, etc - Suitable for version control
- Suitable for scripting
Types of documentation
Component diagrams
Preferred tool : PlantUML
Note PlantUML requires graphviz
to be installed to generate component diagrams.
|
|
@startuml
title Kubernetes
skinparam componentStyle uml2
package "Development" {
component Developer
component [Code\nVCS] as VCS
component CI
component CD
}
package "External Services" {
component MQ
component DB
}
package "Kubernetes Cluster" {
component "Nodes/Pods/Containers" as Service
component [Controller] as Controller
}
package Artifacts {
component [Container Registry] as Registry
component [Config VCS] as Config
}
package "External Network" {
component [User] as WebBrowser
}
Developer -l-> VCS : commit
VCS -d-> CI : test & build
CI -r-> CD
CI -d-> Registry : upload image
CD -r-> Controller : deploy
WebBrowser -u-> Service
Service -u-> MQ
Service -u-> DB
Controller -r-> Registry : fetch
Controller -d-> Config : fetch
Controller -l-> Service : deploy
@enduml
Useful parameters for Component Diagrams
skinparam componentType uml2
skinparam linetype splines
skinparam linetype ortho
skinparam linetype polyline
Sequence diagrams
Preferred tool : PlantUML
Note: PlantUML can generate sequence diagrams using only the plantuml.jar
file.
@startuml
title Data flow
entity "Data Source" as DataSource
box "Integration" #lightblue
entity "fluent-bit" as fluentbit
entity "envoy" as envoy
end box
box "Monitoring"
entity "Prometheus" as Prometheus
entity "Grafana" as Grafana
end box
box "Splunk Platform" #lightblue
entity "Splunk\nHeavy Forwarder" as HF
database "Splunk Index" as IDX
entity "Splunk SHC" as SHC
end box
actor "User" as User
== Events ==
DataSource -> fluentbit
fluentbit -> envoy : HTTP-Proxy/HEC
envoy -> HF : HTTP/HEC
HF -> IDX : TCP/Splunk forward
== Metrics ==
envoy -> Prometheus : metrics
fluentbit -> Prometheus : Metrics over HTTP
== Reporting ==
Prometheus -> Grafana
Grafana -> User : HTTP
IDX -> SHC
SHC -> User : HTTP
@enduml
Timing diagrams
Preferred tool : PlantUML
@startuml
robust "CPU0" as CPU0
robust "CPU1" as CPU1
concise "Task Progress" as TaskProgress
concise "Task Breakdown" as TaskBreakdown
@0
TaskProgress is Idle
TaskBreakdown is None
CPU1 is Idle
CPU0 is Idle
@100
TaskProgress is Running
TaskBreakdown is Serial
CPU0 is PreparingTask
CPU1 is Idle : Idle
CPU0@100 <-> @200 : 100 ms
@200
TaskBreakdown is Parallel
CPU0 is NumberCrunching
CPU0 -> CPU1 : Distribute task
CPU1 is NumberCrunching
@700
TaskProgress is Idle
TaskBreakdown is None
CPU1 -> CPU0 : Complete task
CPU0 is Idle
CPU1 is Idle
@1200
CPU0 is Idle
CPU1 is Idle
@enduml
Graph visualization
Preferred tool : Graphviz
|
|
digraph G {
{node [label="Developer" style=filled color=skyblue] d1 d2 d3 d4 d5 }
d1 -> d2 [len=2];
d1 -> d3 [len=2];
d1 -> d4 [len=2];
d1 -> d5 [len=2];
d2 -> d1 [len=2];
d2 -> d3 [len=2];
d2 -> d4 [len=2];
d2 -> d5 [len=2];
d3 -> d1 [len=2];
d3 -> d2 [len=2];
d3 -> d4 [len=2];
d3 -> d5 [len=2];
d4 -> d1 [len=2];
d4 -> d2 [len=2];
d4 -> d3 [len=2];
d4 -> d5 [len=2];
d5 -> d1 [len=2];
d5 -> d2 [len=2];
d5 -> d3 [len=2];
d5 -> d4 [len=2];
}
Flow charts
Preferred tool : PlantUML
@startuml
scale 4
:Perform task;
note right
E.g. Manually resize a volume
end note
->
if (OK?) then
-[#blue]-> p=**0.97**;
:Task complete;
-[#blue]-> Info;
#Lightblue:Success1 = 0.97;
-[#blue]->
else
-[#red]-> p=**0.03**;
:Emergency with plan;
note right: Follow rollback procedure
-[#red]->
if (Recover?) then
-[#green]-> p=**0.90**;
#Lightgreen:Abort1 = (0.03 * 0.90);
-[#green]->
stop
else
-[#red]-> p=**0.10**;
:Emergency without plan;
-[#red]->
if (Recover?) then
-[#green]-> p=**0.70**;
#Lightgreen: Abort2 = (0.03 * 0.10 * 0.70);
-[#green]->
stop
else
-[#red]-> p=**0.30**;
#Pink: Failure1 = (0.03 * 0.10 * 0.30);
-[#red]->
stop
endif
endif
endif
-[#blue]->;
stop
@enduml
Plotting
Preferred tool : gnuplot
|
|
|
|
Presentations
Preferred tool : pandoc
|
|
Reports
Preferred tool : pandoc
|
|