Skip to content

Commit 6fa0199

Browse files
authored
chore: replace huge mermaid with tam diagram (open-component-model#1826)
<!-- markdownlint-disable MD041 --> #### What this PR does / why we need it This diagram provides a concise overview of the architecture of the ocm k8s toolkit and the interaction between the different services involved. #### Which issue(s) this PR fixes <!-- Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`. --> --------- Signed-off-by: Fabian Burth <fabian.burth@sap.com>
1 parent 12ab96d commit 6fa0199

File tree

2 files changed

+6
-109
lines changed

2 files changed

+6
-109
lines changed

kubernetes/controller/README.md

Lines changed: 5 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -25,117 +25,13 @@ You should be familiar with the following concepts:
2525
> The following section provides a high-level overview of the OCM K8s Toolkit and its components regarding the
2626
> deployment of an OCM resource in a very basic scenario.
2727
28-
The primary purpose of OCM K8s Toolkit is simple: Deploy an OCM resource from an OCM component version into a Kubernetes
29-
cluster.
30-
31-
The implementation, however, is a bit more complex as deployments must be secure and configurable. Additionally, an
32-
OCM Resource can, in theory, contain any form of deployable resource, for instance a Helm chart, a Kustomization, or
33-
plain Kubernetes manifests. Each of these resources has its own way of being deployed or
34-
configured. So, instead of creating a generic deployer that offers all these functionalities, we decided to use existing
35-
tools that are already available in the Kubernetes ecosystem.
36-
37-
The following diagram describes a basic scenario in which an OCM resource containing a Helm chart is deployed into a
38-
Kubernetes cluster using the OCM K8s Toolkit as well as kro and FluxCD.
39-
kro is used to orchestrate the deployment and to transport information about the location of the OCM resource to FluxCD.
40-
FluxCD takes the location of the OCM resource, downloads the chart, configures it if necessary,
41-
and deploys it into the Kubernetes cluster.
42-
43-
```mermaid
44-
flowchart TB
45-
classDef cluster fill:white,color:black,stroke:black;
46-
classDef reconciledBy fill:#dedede,stroke:black,stroke-dasharray: 5,color:black;
47-
classDef k8sObject fill:#b3b3b3,color:black,stroke:black;
48-
classDef information fill:#b3b3b3,color:black,stroke:black,stroke-dasharray: 2;
49-
classDef ocm fill:white,stroke:black,color:black;
50-
classDef legendStyle fill:white,stroke:black,color:black,stroke-dasharray: 2;
51-
classDef legendStartEnd height:0px;
52-
classDef legendItems fill:#b3b3b3,stroke:none,color:black;
53-
54-
subgraph legend[Legend]
55-
start1[ ] ---references[referenced by] --> end1[ ]
56-
start2[ ] -.-creates -.-> end2[ ]
57-
start3[ ] ---instanceOf[instance of] --> end3[ ]
58-
start4[ ] ~~~reconciledBy[reconciled by] ~~~ end4[ ]
59-
start5[ ] ~~~k8sObject[k8s object] ~~~ end5[ ]
60-
start6[ ] ~~~templateOf[template of] ~~~ end6[ ]
61-
end
62-
63-
subgraph background[ ]
64-
direction TB
65-
66-
subgraph ocmRepo[OCM Repository]
67-
subgraph ocmCV[OCM Component Version]
68-
subgraph ocmResource[OCM Resource: HelmChart]
69-
end
70-
end
71-
end
72-
73-
subgraph k8sCluster[Kubernetes Cluster]
74-
subgraph kroRGD[kro]
75-
subgraph rgd[RGD: Simple]
76-
direction LR
77-
rgdRepository[Repository]
78-
rgdComponent[Component]
79-
rgdResourceHelm[Resource: HelmChart]
80-
rgdSource[FluxCD: OCI Repository]
81-
rgdHelmRelease[FluxCD: HelmRelease]
82-
end
83-
end
84-
subgraph kroInstance[kro]
85-
subgraph instanceSimple[Instance: Simple]
86-
subgraph ocmK8sToolkit[OCM K8s Toolkit]
87-
k8sRepo[Repository] --> k8sComponent[Component] --> k8sResource[Resource: HelmChart]
88-
end
89-
subgraph fluxCD[FluxCD]
90-
source[OCI Repository] --> helmRelease[HelmRelease]
91-
end
92-
k8sResource --> source
93-
end
94-
end
95-
kroRGD & instanceSimple --> crdSimple[CRD: Simple]
96-
helmRelease --> deployment[Deployment: Helm chart]
97-
end
98-
99-
ocmRepo --> k8sRepo
100-
end
101-
102-
linkStyle default fill:none,stroke:black;
103-
linkStyle 2,3,16,18 stroke:black,stroke-dasharray: 10;
104-
linkStyle 4,5,17 stroke:black,stroke-dasharray: 4;
105-
106-
class start1,end1,start2,end2,start3,end3,start4,end4,start5,end5,start6,end6 legendStartEnd;
107-
class references,creates,instanceOf legendItems;
108-
class templateOf,rgdRepository,rgdComponent,rgdResourceHelm,rgdSource,rgdHelmRelease information;
109-
class reconciledBy,ocmK8sToolkit,fluxCD,kroRGD,kroInstance reconciledBy;
110-
class k8sObject,rgd,k8sRepo,k8sComponent,k8sResource,source,helmRelease,deployment,crdSimple,instanceSimple k8sObject;
111-
class ocmRepo,ocmCV,ocmResource ocm;
112-
class k8sCluster cluster;
113-
class legend legendStyle;
114-
```
115-
116-
The above diagram shows an OCM resource of type `helmChart`. This resource is part of an OCM component version,
117-
which is located in an OCM repository.
118-
119-
In the `Kubernetes Cluster` we can see several Kubernetes (custom) resources. The `ResourceGraphDefintion`
120-
(`RGD: Simple`) contains the template of all the resources for deploying the Helm chart into the Kubernetes cluster.
121-
kro creates a Custom Resource Definition (CRD) `Simple` based on that `ResourceGraphDefinition`. By creating an instance
122-
of this CRD (`Instance: Simple`), the resources are created and reconciled by the respective controllers:
123-
124-
- `Repository`: Points to the OCM repository and checks if it is reachable by pinging it.
125-
- `Component`: Refers to the `Repository` and downloads and verifies the OCM component version descriptor.
126-
- `Resource`: Points to the `Component`, downloads the OCM component version descriptor from which it gets the location
127-
of the OCM resource. It then downloads the resource to verify its signature (optional) and publishes the location of the
128-
resource in its status.
28+
The primary purpose of OCM K8s Toolkit is simple: Deploy an OCM resource
29+
from an OCM component version into a Kubernetes cluster.
12930

130-
> [!IMPORTANT]
131-
> With FluxCD, this only works if the OCM resource has an access for which FluxCD has a corresponding Source type (e.g.
132-
> an OCI or a GitHub repository)
133-
134-
As a result, FluxCD can now consume the information of the `Resource` and deploy the Helm chart:
31+
The diagram below provides an overview of the architecture of the OCM
32+
K8s Toolkit.
13533

136-
- `OCIRepository`: Watches and downloads the resource from the location provided by the `Resource` status.
137-
- `HelmRelease`: Refers to the `OCIRepository`, lets you configure the Helm chart, and creates the deployment into the
138-
Kubernetes cluster.
34+
![Architecture of OCM K8s Toolkit](./docs/assets/controller-tam.svg)
13935

14036
## Installation
14137

0 commit comments

Comments
 (0)