Skip to content

Commit 8c4ee76

Browse files
Add documentation
1 parent fc7e23a commit 8c4ee76

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

docs/modules/ROOT/pages/reference/architecture.adoc

+46
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,52 @@ Commodore currently doesn't provide support for component authors to specify lib
299299
It's the responsibility of component authors to agree on an interface and to ensure that their implementations adhere to the interface.
300300
====
301301

302+
=== Using different component versions across instances
303+
304+
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.
305+
Component authors must explicitly declare that their component supports multi-version instantiation.
306+
Components advertise that they support multi-version instantiation by setting the field `multi_version` in `parameters.<component_name>._metadata` to `true`.
307+
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.
308+
309+
Specifying the version of a component instance is done analogously to specifying the version of a base component or single-instance component.
310+
The component version is specified in `parameters.components.<instance_name>`. The content is merged into `parameters.components.<component_name>`.
311+
312+
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.
313+
314+
.tenant/common.yml
315+
[source,yaml]
316+
----
317+
applications:
318+
- nfs-subdir-external-provisioner
319+
- nfs-subdir-external-provisioner as nfs-2
320+
- nfs-subdir-external-provisioner as nfs-3
321+
parameters:
322+
components:
323+
nfs-subdir-external-provisioner: <1>
324+
url: https://github.com/projectsyn/nfs-subdir-external-provisioner.git
325+
version: v1.0.0
326+
nfs-2:
327+
version: v1.1.0 <2>
328+
nfs-3:
329+
url: https://github.com/projectsyn/nfs-subdir-external-provisioner-fork.git <3>
330+
version: v1.1.0
331+
----
332+
<1> The URL and version of the base component must always be specified.
333+
Component instance version configurations will be merged into this base configuration.
334+
<2> If only a version is specified for an instance, then the same URL as the base component will be used.
335+
<3> It is possible to specify a different URL, for example, to use a fork of a component for this particular instance.
336+
337+
[NOTE]
338+
====
339+
If a component requires Jsonnet dependencies, those are always provided from the base (non-instantiated) version of the component.
340+
In other words, if a component instance overrides the version, its Jsonnet dependencies are provided from a different component version.
341+
342+
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)
343+
====
344+
345+
346+
347+
302348
== Catalog Compilation
303349

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

0 commit comments

Comments
 (0)