Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
HappyTetrahedron committed Jan 30, 2025
1 parent fc7e23a commit d9bc703
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions docs/modules/ROOT/pages/reference/architecture.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,52 @@ Commodore currently doesn't provide support for component authors to specify lib
It's the responsibility of component authors to agree on an interface and to ensure that their implementations adhere to the interface.
====

=== Using different component versions across instances

With https://syn.tools/syn/SDDs/0033-commodore-component-instance-versioning.html[SDD0033], we've introduced support for instantiating components with different versions, meaning that different instances of the same component may use a different dependency or different versions of the same dependency.
Component authors must explicitly declare that their component supports multi-version instantiation.
Components advertise that they support multi-version instantiation by setting the field `multi_version` in `parameters.<component_name>._metadata` to `true`.
Commodore will exit with an error if a hierarchy tries to override the version of a component instance where the component doesn't explicitly advertise multi-version support.

Specifying the version of a component instance is done analogously to specifying the version of a base component or single-instance component.
The component version is specified in `parameters.components.<instance_name>`. The content is merged into `parameters.components.<component_name>`.

The version of the base component (`parameters.components.<component_name>`) must always be specified explicitly, even if the component is only used with instance names.

.tenant/common.yml
[source,yaml]
----
applications:
- nfs-subdir-external-provisioner
- nfs-subdir-external-provisioner as nfs-2
- nfs-subdir-external-provisioner as nfs-3
parameters:
components:
nfs-subdir-external-provisioner: <1>
url: https://github.com/projectsyn/nfs-subdir-external-provisioner.git
version: v1.0.0
nfs-2:
version: v1.1.0 <2>
nfs-3:
url: https://github.com/projectsyn/nfs-subdir-external-provisioner-fork.git <3>
version: v1.1.0
----
<1> The URL and version of the base component must always be specified.
Component instance version configurations will be merged into this base configuration.
<2> If only a version is specified for an instance, then the same URL as the base component will be used.
<3> It's possible to specify a different URL, for example, to use a fork of a component for this particular instance.

[NOTE]
====
If a component requires Jsonnet dependencies, those are always provided from the base (non-instantiated) version of the component.
In other words, if a component instance overrides the version, its Jsonnet dependencies are provided from a different component version.
Similarly, if other components include references to a multi-version component's `defaults.yml` or to Jsonnet libraries provided by the multi-version component, then those files are always taken from the base (non-instantiated)
====




== Catalog Compilation

Commodore uses https://kapitan.dev[Kapitan] to compile the cluster catalog.
Expand Down

0 comments on commit d9bc703

Please sign in to comment.