docs: add deployer concept doc and adjust other guides#761
Conversation
On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com> Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
✅ Deploy Preview for open-component-model ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis pull request consolidates Helm chart deployment documentation by creating a comprehensive new tutorial, moving content from getting-started guides into a unified resource, removing a separate bootstrap tutorial, expanding the OCM controllers concept page, and updating all internal documentation cross-references to point to the reorganized content. Additionally, the wordlist and a new Kubernetes Deployer concept page are added. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~18 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com> Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
Signed-off-by: Gergely Bräutigam <gergely.brautigam@sap.com>
On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com> Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
…Skarlso/ocm-website into document-and-refactor-the-deployer-docs
Signed-off-by: Gergely Bräutigam <gergely.brautigam@sap.com>
1edaf80 to
807cd14
Compare
On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com> Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
807cd14 to
b25268b
Compare
On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com> Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
|
|
||
| This tutorial walks you through deploying a Helm chart from an OCM component version to a Kubernetes cluster, | ||
| using the OCM Controllers with kro and Flux. | ||
| This guide gives you a quick overview of deploying a Helm chart using the OCM Controllers. |
There was a problem hiding this comment.
Arguable, this isn't needed anymore. 🤔
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (5)
content/docs/concepts/ocm-controllers.md (1)
7-7: Optional: hasMermaid flag is auto-set.The
hasMermaid: trueflag is automatically set by therender-codeblock-mermaid.htmltemplate when Mermaid code blocks are rendered (see the relevant code snippet). Including it in frontmatter is redundant but harmless—it can serve as documentation that the page contains diagrams.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@content/docs/concepts/ocm-controllers.md` at line 7, Remove the redundant frontmatter key `hasMermaid: true` from the document (it's auto-set by the `render-codeblock-mermaid.html` template) — open the file containing the `hasMermaid` frontmatter entry, delete that line so the page relies on the template to set the flag, and leave a brief inline comment only if you want to document that the template auto-sets the flag for Mermaid diagrams.content/docs/concepts/deployer.md (1)
36-38: Optional: Consider more concise wording.The phrase "In order to get to a deployment" could be simplified to "To reach deployment" for conciseness, though the current wording is not incorrect.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@content/docs/concepts/deployer.md` around lines 36 - 38, The opening sentence is wordy—replace "In order to get to a deployment the following chain of objects has to be reconciled." with a more concise phrasing like "To reach deployment, the following chain of objects must be reconciled:" and keep the rest of the paragraph intact; update the sentence that references Repository, Component, Resource, and Deployer to maintain clarity and punctuation (use a colon after the concise sentence and ensure the object chain is exactly "Repository -> Component -> Resource -> Deployer").content/docs/tutorials/deploy-with-controllers.md (3)
381-381: Add a cautionary note aboutinsecure: trueflag.Setting
insecure: truein the OCIRepository spec disables TLS verification and should only be used for local testing or development environments. This could be misleading for users following the tutorial in production settings.
⚠️ Proposed addition of a warning calloutAdd a callout after line 388 (before the helmrelease section):
{{<callout context="caution" title="Insecure Registry" icon="outline/alert-triangle">}} The `insecure: true` flag is set for local testing only. Remove this flag when using TLS-enabled registries in production. {{</callout>}}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@content/docs/tutorials/deploy-with-controllers.md` at line 381, Add a cautionary callout near the OCIRepository spec where the insecure: true flag is set: insert a warning callout mentioning "Insecure Registry" and that insecure: true is for local testing only and must be removed for TLS-enabled registries in production; place this callout immediately before the HelmRelease section referenced in the doc so readers see it right after the OCIRepository example that includes insecure: true.
34-34: Minor style improvement: simplify "outside of" to "outside".The phrase "outside of" is slightly redundant in this context.
✏️ Proposed fix
-In this approach, you create the `ResourceGraphDefinition` outside of the OCM component and apply it directly to the cluster. +In this approach, you create the `ResourceGraphDefinition` outside the OCM component and apply it directly to the cluster.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@content/docs/tutorials/deploy-with-controllers.md` at line 34, Replace the phrase "outside of the OCM component" with the simpler "outside the OCM component" in the sentence that references creating the ResourceGraphDefinition; locate the sentence containing `ResourceGraphDefinition` and update that wording to use "outside" instead of "outside of" for the minor style improvement.
405-405: Reconsider combining tag and digest in a single Helm values field.The OCI reference format
tag@digestis valid per the image specification and is supported in this project's documentation. However, storing both tag and digest in a singletagfield (as${resourceImage.status.additional.tag}@${resourceImage.status.additional.digest}) deviates from Helm best practices.The recommended approach is to use separate fields for flexibility:
- Separate
taganddigestfields in values, or- Use a unified
versionfield that can hold either a tag (e.g.,1.0.0) or a digest (e.g.,sha256:...)- Then use a Helm template helper to construct the image reference appropriately (with
:for tags,@for digests)This approach improves clarity, reusability, and allows easier overrides by users.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@content/docs/tutorials/deploy-with-controllers.md` at line 405, The Helm values currently combine tag and digest into one field (`tag: ${resourceImage.status.additional.tag}@${resourceImage.status.additional.digest}`); change values to expose separate fields (e.g., values.image.tag and values.image.digest) or a single values.image.version that may hold either a tag or a digest, and update the chart templates (the helper used to render image references) to construct the final reference using ":" when a tag is present and "@" when a digest is present; update any places referencing `tag` to use the new fields (`values.image.tag`, `values.image.digest`, or `values.image.version`) and adjust the helper/template that currently consumes `tag` so image references are built consistently.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@content/docs/tutorials/deploy-with-controllers.md`:
- Line 81: Fix the incomplete sentence by adding a conjunction and cleaning verb
tense: change the sentence that references `component-constructor.yaml` so it
reads like "By default, this looks for `component-constructor.yaml` in the
current directory and will create a component version directly in the target OCI
repository." or alternatively "By default, this looks for
`component-constructor.yaml` in the current directory and creates a component
version directly in the target OCI repository." Update the sentence containing
`component-constructor.yaml` accordingly.
---
Nitpick comments:
In `@content/docs/concepts/deployer.md`:
- Around line 36-38: The opening sentence is wordy—replace "In order to get to a
deployment the following chain of objects has to be reconciled." with a more
concise phrasing like "To reach deployment, the following chain of objects must
be reconciled:" and keep the rest of the paragraph intact; update the sentence
that references Repository, Component, Resource, and Deployer to maintain
clarity and punctuation (use a colon after the concise sentence and ensure the
object chain is exactly "Repository -> Component -> Resource -> Deployer").
In `@content/docs/concepts/ocm-controllers.md`:
- Line 7: Remove the redundant frontmatter key `hasMermaid: true` from the
document (it's auto-set by the `render-codeblock-mermaid.html` template) — open
the file containing the `hasMermaid` frontmatter entry, delete that line so the
page relies on the template to set the flag, and leave a brief inline comment
only if you want to document that the template auto-sets the flag for Mermaid
diagrams.
In `@content/docs/tutorials/deploy-with-controllers.md`:
- Line 381: Add a cautionary callout near the OCIRepository spec where the
insecure: true flag is set: insert a warning callout mentioning "Insecure
Registry" and that insecure: true is for local testing only and must be removed
for TLS-enabled registries in production; place this callout immediately before
the HelmRelease section referenced in the doc so readers see it right after the
OCIRepository example that includes insecure: true.
- Line 34: Replace the phrase "outside of the OCM component" with the simpler
"outside the OCM component" in the sentence that references creating the
ResourceGraphDefinition; locate the sentence containing
`ResourceGraphDefinition` and update that wording to use "outside" instead of
"outside of" for the minor style improvement.
- Line 405: The Helm values currently combine tag and digest into one field
(`tag:
${resourceImage.status.additional.tag}@${resourceImage.status.additional.digest}`);
change values to expose separate fields (e.g., values.image.tag and
values.image.digest) or a single values.image.version that may hold either a tag
or a digest, and update the chart templates (the helper used to render image
references) to construct the final reference using ":" when a tag is present and
"@" when a digest is present; update any places referencing `tag` to use the new
fields (`values.image.tag`, `values.image.digest`, or `values.image.version`)
and adjust the helper/template that currently consumes `tag` so image references
are built consistently.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: bb417efe-780e-47a1-b38d-c35fecd2df12
📒 Files selected for processing (10)
.github/config/wordlist.txtcontent/docs/concepts/deployer.mdcontent/docs/concepts/ocm-controllers.mdcontent/docs/concepts/transfer-concept.mdcontent/docs/getting-started/_index.mdcontent/docs/getting-started/deploy-helm-chart.mdcontent/docs/getting-started/setup-controller-environment.mdcontent/docs/how-to/air-gap-transfer.mdcontent/docs/tutorials/deploy-helm-chart-bootstrap.mdcontent/docs/tutorials/deploy-with-controllers.md
💤 Files with no reviewable changes (1)
- content/docs/tutorials/deploy-helm-chart-bootstrap.md
On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com> Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
| @@ -0,0 +1,107 @@ | |||
| --- | |||
| title: "Deployer" | |||
There was a problem hiding this comment.
"Controller Deployer" or "Kubernetes Deployer" would be a better name here to indicate, that we are talking about controller stuff
|
|
||
| ```shell | ||
| ocm add cv --repository ghcr.io/<your-namespace>/repository \ | ||
| --component-version-conflict-policy replace |
There was a problem hiding this comment.
since this is a tutorial, we need a bit more hand-holding here. Can you explain what --component-version-conflict-policy replace does and why we should use it in here?
There was a problem hiding this comment.
Instead of that, I will just completely remove it. :D So there is no problem and we don't accidentally introduce another concept. WDYT?
On-behalf-of: Gergely Brautigam <gergely.brautigam@sap.com> Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
|
|
||
| This tutorial walks you through deploying a Helm chart from an OCM component version to a Kubernetes cluster, | ||
| using the OCM Controllers with kro and Flux. | ||
| The [OCM Controllers]({{< relref "ocm-controllers.md" >}}) deploy Helm charts from OCM component versions into Kubernetes clusters using kro and Flux. The basic flow is: |
There was a problem hiding this comment.
Okay, I simplified a bunch of things. Do we even need this doc now? 🤔
There was a problem hiding this comment.
Not if its moved to the tutorial :D
There was a problem hiding this comment.
According to the issue description the content is just moved to the tutorial
There was a problem hiding this comment.
Hm, maybe we want to use this document to show a deployment without the bootstrap-shenanigans as it is not the easiest entrypoint.
In this guide you could just apply a manifest to a cluster. WDYT?
|
|
||
| ## How It Works | ||
|
|
||
| The Deployer references an OCM `Resource` object. When that resource becomes ready, the Deployer downloads the referenced blob, decodes any YAML/JSON manifests it contains, and applies them to the cluster. |
There was a problem hiding this comment.
| The Deployer references an OCM `Resource` object. When that resource becomes ready, the Deployer downloads the referenced blob, decodes any YAML/JSON manifests it contains, and applies them to the cluster. | |
| The Deployer references an OCM `Resource` object. When the status of that resource becomes `Ready`, the Deployer downloads the referenced blob, decodes any YAML/JSON manifests it contains, and applies them to the cluster. |
| The Deployer stamps deployed resources with metadata for traceability: | ||
|
|
||
| **Labels:** | ||
|
|
||
| | Label | Value | | ||
| |-------|-------| | ||
| | `app.kubernetes.io/managed-by` | `deployer.delivery.ocm.software` | | ||
| | `app.kubernetes.io/name` | Resource name | | ||
| | `app.kubernetes.io/version` | Resource version | | ||
| | `app.kubernetes.io/part-of` | Deployer name | | ||
|
|
||
| **Annotations:** | ||
|
|
||
| | Annotation | Value | | ||
| |------------|-------| | ||
| | `digest.resource.delivery.ocm.software/value` | Resource digest | | ||
| | `component.delivery.ocm.software/name` | Component name | | ||
| | `component.delivery.ocm.software/version` | Component version | |
There was a problem hiding this comment.
This is good for using tabs
| The Deployer stamps deployed resources with metadata for traceability: | ||
|
|
||
| **Labels:** | ||
|
|
||
| | Label | Value | | ||
| |-------|-------| | ||
| | `app.kubernetes.io/managed-by` | `deployer.delivery.ocm.software` | | ||
| | `app.kubernetes.io/name` | Resource name | | ||
| | `app.kubernetes.io/version` | Resource version | | ||
| | `app.kubernetes.io/part-of` | Deployer name | | ||
|
|
||
| **Annotations:** | ||
|
|
||
| | Annotation | Value | | ||
| |------------|-------| | ||
| | `digest.resource.delivery.ocm.software/value` | Resource digest | | ||
| | `component.delivery.ocm.software/name` | Component name | | ||
| | `component.delivery.ocm.software/version` | Component version | |
There was a problem hiding this comment.
| The Deployer stamps deployed resources with metadata for traceability: | |
| **Labels:** | |
| | Label | Value | | |
| |-------|-------| | |
| | `app.kubernetes.io/managed-by` | `deployer.delivery.ocm.software` | | |
| | `app.kubernetes.io/name` | Resource name | | |
| | `app.kubernetes.io/version` | Resource version | | |
| | `app.kubernetes.io/part-of` | Deployer name | | |
| **Annotations:** | |
| | Annotation | Value | | |
| |------------|-------| | |
| | `digest.resource.delivery.ocm.software/value` | Resource digest | | |
| | `component.delivery.ocm.software/name` | Component name | | |
| | `component.delivery.ocm.software/version` | Component version | | |
| The Deployer stamps deployed resources with metadata for traceability in the form of **labels** and **annotations**: | |
| {{< tabs >}} | |
| {{< tab "Labels" >}} | |
| | Label | Value | | |
| |-------|-------| | |
| | `app.kubernetes.io/managed-by` | `deployer.delivery.ocm.software` | | |
| | `app.kubernetes.io/name` | Resource name | | |
| | `app.kubernetes.io/version` | Resource version | | |
| | `app.kubernetes.io/part-of` | Deployer name | | |
| {{< /tab >}} | |
| {{< tab "Annotations" >}} | |
| | Annotation | Value | | |
| |------------|-------| | |
| | `digest.resource.delivery.ocm.software/value` | Resource digest | | |
| | `component.delivery.ocm.software/name` | Component name | | |
| | `component.delivery.ocm.software/version` | Component version | | |
| {{< /tab >}} | |
| {{< /tabs >}} |
|
|
||
| ```text | ||
| COMPONENT │ VERSION │ PROVIDER | ||
| ─────────────────────────────────────┼─────────┼────────────── |
There was a problem hiding this comment.
| ─────────────────────────────────────┼─────────┼────────────── | |
| ────────────────────────────────────┼─────────┼────────────── |
|
|
||
| ```text | ||
| COMPONENT │ VERSION │ PROVIDER | ||
| ─────────────────────────────────────┼─────────┼────────────── |
There was a problem hiding this comment.
| ─────────────────────────────────────┼─────────┼────────────── | |
| ────────────────────────────────────┼─────────┼────────────── |
|
|
||
| #### Apply the ResourceGraphDefinition | ||
|
|
||
| When kro processes the RGD, it generates a new Custom Resource Definition (CRD), in this case, a `Simple` kind that you can instantiate later: |
There was a problem hiding this comment.
| When kro processes the RGD, it generates a new Custom Resource Definition (CRD), in this case, a `Simple` kind that you can instantiate later: | |
| When kro processes the RGD, it generates a new CustomResourceDefinition (CRD), in this case, a `Simple` kind that you can instantiate later: |
|
|
||
| #### Create an instance | ||
|
|
||
| Create `instance.yaml`. This creates a `Simple` resource, kro sees it and instantiates all the resources defined in the RGD, wiring them together automatically: |
There was a problem hiding this comment.
| Create `instance.yaml`. This creates a `Simple` resource, kro sees it and instantiates all the resources defined in the RGD, wiring them together automatically: | |
| Create a file `instance.yaml`. With this you can create a resource `Simple`. When kro detects it, it instantiates all the resources defined in the RGD, wiring them together automatically: |
| kubectl apply -f instance.yaml | ||
| ``` | ||
|
|
||
| Wait for the deployment. kro reconciles the full chain. OCM repository, component, resource, Flux source, and Helm release: |
There was a problem hiding this comment.
| Wait for the deployment. kro reconciles the full chain. OCM repository, component, resource, Flux source, and Helm release: | |
| Wait for the deployment. kro reconciles the full chain: OCM repository, component, resource, Flux source, and Helm release: |
| In this approach, the `ResourceGraphDefinition` is packaged inside the OCM component. The [Deployer]({{< relref "kubernetes-deployer.md" >}}) extracts and applies it automatically. This also demonstrates **localization**, injecting an updated image reference into the Helm chart values. | ||
|
|
||
| {{<callout context="note" title="Localization" icon="outline/current-location">}} | ||
| **Localization** inserts a new image reference into the deployment instructions. When an OCM component is transferred with `--copy-resources`, referential resources update their image references to the new registry. The Deployer and FluxCD's `HelmRelease` values field propagate this change into the actual deployment. |
There was a problem hiding this comment.
| **Localization** inserts a new image reference into the deployment instructions. When an OCM component is transferred with `--copy-resources`, referential resources update their image references to the new registry. The Deployer and FluxCD's `HelmRelease` values field propagate this change into the actual deployment. | |
| **Localization** inserts a new image reference into the deployment instructions. When an OCM component is transferred with `--copy-resources`, the image references of resources are updated to their new registry. The Deployer and Flux's `HelmRelease` values field propagate this change into the actual deployment. |
| {{< /step >}} | ||
|
|
||
| {{<callout context="note" title="globalAccess vs direct access" icon="outline/info-circle">}} | ||
| Unlike Part 1, this RGD uses `resource.access.globalAccess.toOCI()` instead of `resource.access.toOCI()`. When the component is transferred with `--copy-resources`, the resources are copied into the target registry and the component descriptor records a _local_ reference to them. The `globalAccess` field resolves the resource through its relocated OCI reference, which is required for the HelmRelease to pull the artifact ( the podinfo image ) from the correct registry. |
There was a problem hiding this comment.
| Unlike Part 1, this RGD uses `resource.access.globalAccess.toOCI()` instead of `resource.access.toOCI()`. When the component is transferred with `--copy-resources`, the resources are copied into the target registry and the component descriptor records a _local_ reference to them. The `globalAccess` field resolves the resource through its relocated OCI reference, which is required for the HelmRelease to pull the artifact ( the podinfo image ) from the correct registry. | |
| Unlike in Part 1, this RGD uses `resource.access.globalAccess.toOCI()` instead of `resource.access.toOCI()`. When the component is transferred with `--copy-resources`, the resources are copied into the target registry and the component descriptor records a _local_ reference to them. The `globalAccess` field resolves the resource through its relocated OCI reference, which is required for the HelmRelease to pull the artifact (the podinfo image) from the correct registry. |
There was a problem hiding this comment.
I think this whole section is outdated.
|
|
||
| #### Define the component | ||
|
|
||
| Create `component-constructor.yaml`. This component bundles three resources: the Helm chart, the application image (for localization), and the RGD itself: |
There was a problem hiding this comment.
| Create `component-constructor.yaml`. This component bundles three resources: the Helm chart, the application image (for localization), and the RGD itself: | |
| Create a file `component-constructor.yaml`. This component bundles three resources: the Helm chart, the application image (for localization), and the RGD itself: |
| Then transfer it to the registry with `--copy-resources`. This copies the referenced OCI artifacts (Helm chart and image) into your registry, which is what enables localization. The component descriptor is updated to point at the new locations: | ||
|
|
||
| ```shell | ||
| ocm transfer cv ctf::./transport-archive//ocm.software/ocm-k8s-toolkit/bootstrap:1.0.0 \ |
There was a problem hiding this comment.
| ocm transfer cv ctf::./transport-archive//ocm.software/ocm-k8s-toolkit/bootstrap:1.0.0 \ | |
| ocm transfer cv ./transport-archive//ocm.software/ocm-k8s-toolkit/bootstrap:1.0.0 \ |
There was a problem hiding this comment.
I guess we can omit the ctf: scheme, or?
|
|
||
| ## ApplySet Semantics | ||
|
|
||
| The Deployer uses [ApplySet](https://kubernetes.io/docs/reference/labels-annotations-taints/#kubectl-applyset) (KEP-3659) for resource lifecycle management. |
There was a problem hiding this comment.
The hyperlink #kubectl-applyset does not work
| ## Installation | ||
|
|
||
| Currently, the OCM controllers are available as [image][controller-image] and | ||
| [Kustomization](https://github.com/open-component-model/open-component-model/blob/main/kubernetes/controller/config/default/kustomization.yaml). A Helm chart is planned for the future. |
There was a problem hiding this comment.
This is not up-to-date. We have a helm chart
| an OCM resource into a Kubernetes cluster. The OCM controllers deployment, however, does not contain kro or any | ||
| deployer. Please refer to the respective installation guides for these tools: | ||
| {{<callout context="caution" title="kro" icon="outline/alert-triangle">}} | ||
| The OCM controllers deployment does not include kro. If you plan to use `ResourceGraphDefinitions`, install kro separately: |
There was a problem hiding this comment.
"and make sure to apply the appropriate permissions (Link to the RBAC doc)"
|
|
||
| This tutorial walks you through deploying a Helm chart from an OCM component version to a Kubernetes cluster, | ||
| using the OCM Controllers with kro and Flux. | ||
| The [OCM Controllers]({{< relref "ocm-controllers.md" >}}) deploy Helm charts from OCM component versions into Kubernetes clusters using kro and Flux. The basic flow is: |
There was a problem hiding this comment.
Not if its moved to the tutorial :D
|
|
||
| This tutorial walks you through deploying a Helm chart from an OCM component version to a Kubernetes cluster, | ||
| using the OCM Controllers with kro and Flux. | ||
| The [OCM Controllers]({{< relref "ocm-controllers.md" >}}) deploy Helm charts from OCM component versions into Kubernetes clusters using kro and Flux. The basic flow is: |
There was a problem hiding this comment.
According to the issue description the content is just moved to the tutorial
|
|
||
| This tutorial walks you through deploying a Helm chart from an OCM component version to a Kubernetes cluster, | ||
| using the OCM Controllers with kro and Flux. | ||
| The [OCM Controllers]({{< relref "ocm-controllers.md" >}}) deploy Helm charts from OCM component versions into Kubernetes clusters using kro and Flux. The basic flow is: |
There was a problem hiding this comment.
Hm, maybe we want to use this document to show a deployment without the bootstrap-shenanigans as it is not the easiest entrypoint.
In this guide you could just apply a manifest to a cluster. WDYT?
| ocm add cv | ||
| ``` | ||
|
|
||
| Then transfer it to the registry with `--copy-resources`. This copies the referenced OCI artifacts (Helm chart and image) into your registry, which is what enables localization. The component descriptor is updated to point at the new locations: |
There was a problem hiding this comment.
| Then transfer it to the registry with `--copy-resources`. This copies the referenced OCI artifacts (Helm chart and image) into your registry, which is what enables localization. The component descriptor is updated to point at the new locations: | |
| Then transfer it to the target registry with `--copy-resources`. This copies the referenced OCI artifacts (Helm chart and image) into your registry, which is what enables localization. The access locations of the resources in the component descriptor are updated to point to the target registry: |
There was a problem hiding this comment.
Also, saying it "enables localization" feels weird. It's nothing we'd really like to have. I think even though this is a tutorial, you need to explain (or at least link) to a section that explains the rational about localization.
Maybe that's even worth its own concept.
| {{< /steps >}} | ||
|
|
||
| {{<callout context="note">}} | ||
| If using a private registry, see the [OCM CLI credentials documentation]({{<relref "/docs/concepts/credential-system.md">}}). |
There was a problem hiding this comment.
| If using a private registry, see the [OCM CLI credentials documentation]({{<relref "/docs/concepts/credential-system.md">}}). | |
| If you use a private registry, see the [OCM CLI credentials documentation]({{<relref "/docs/concepts/credential-system.md">}}). |
There was a problem hiding this comment.
I think you shouldn't link to a concept section here. The user is trying to work through a tutorial. Link him the https://deploy-preview-761--open-component-model.netlify.app/dev/docs/tutorials/credentials-for-ocm-controllers/ section.
|
|
||
| #### Create bootstrap resources | ||
|
|
||
| Create `bootstrap.yaml`: |
There was a problem hiding this comment.
| Create `bootstrap.yaml`: | |
| Create a file `bootstrap.yaml`: |
| {{<callout context="note" title="Credentials" icon="outline/key">}} | ||
| For private registries, add `ocmConfig` to the Repository, Component, Resource, and Deployer specs. See [Configure Credentials for Controllers]({{<relref "configure-credentials-for-controllers.md">}}). | ||
| {{</callout>}} |
There was a problem hiding this comment.
don't we inherit credentials from top to bottom, so from Repository to component to resource?
| kubectl apply -f bootstrap.yaml | ||
| ``` | ||
|
|
||
| The controllers reconcile in order. Wait for the RGD to appear. This means that the Deployer successfully downloaded and applied it: |
There was a problem hiding this comment.
| The controllers reconcile in order. Wait for the RGD to appear. This means that the Deployer successfully downloaded and applied it: | |
| The controllers reconcile resources in order. Wait for the RGD to appear. This means that the Deployer successfully downloaded and applied it: |
|
|
||
| #### Deploy | ||
|
|
||
| Create `instance.yaml`. This triggers kro to create the `Resource`, `OCIRepository`, and `HelmRelease` objects defined in the RGD: |
There was a problem hiding this comment.
| Create `instance.yaml`. This triggers kro to create the `Resource`, `OCIRepository`, and `HelmRelease` objects defined in the RGD: | |
| Create a file `instance.yaml`. This triggers kro to create the `Resource`, `OCIRepository`, and `HelmRelease` objects defined in the RGD: |
| bootstrap-release-podinfo 1/1 1 1 4m25s | ||
| ``` | ||
|
|
||
| Verify localization. The image should reference your registry, not the original: |
There was a problem hiding this comment.
| Verify localization. The image should reference your registry, not the original: | |
| Verify if the **localization** worked correctly. The image should reference your registry, not the original: |
| - [Tutorial: Create a Multi-Component Product]({{< relref "advanced-component-constructor.md" >}}), complex applications with multiple components | ||
| - [Concept: Deployer]({{< relref "kubernetes-deployer.md" >}}), architecture and lifecycle management | ||
| - [Concept: OCM Controllers]({{< relref "ocm-controllers.md" >}}), overview of the controller ecosystem | ||
|
|
||
| ## Related Documentation | ||
|
|
||
| - [Configure Credentials for Controllers]({{< relref "configure-credentials-for-controllers.md" >}}) | ||
| - [Setup Controller Environment]({{< relref "setup-controller-environment.md" >}}) |
There was a problem hiding this comment.
| - [Tutorial: Create a Multi-Component Product]({{< relref "advanced-component-constructor.md" >}}), complex applications with multiple components | |
| - [Concept: Deployer]({{< relref "kubernetes-deployer.md" >}}), architecture and lifecycle management | |
| - [Concept: OCM Controllers]({{< relref "ocm-controllers.md" >}}), overview of the controller ecosystem | |
| ## Related Documentation | |
| - [Configure Credentials for Controllers]({{< relref "configure-credentials-for-controllers.md" >}}) | |
| - [Setup Controller Environment]({{< relref "setup-controller-environment.md" >}}) | |
| - [How-To:](Configure Credentials for Controllers]({{< relref "configure-credentials-for-controllers.md" >}}) | |
| - [Tutorial: Create a Multi-Component Product]({{< relref "advanced-component-constructor.md" >}}), complex applications with multiple components | |
| ## Related Documentation | |
| - [Concept: Deployer]({{< relref "kubernetes-deployer.md" >}}) - Understand the architecture and lifecycle management of our Kubernetes Controller | |
| - [Concept: OCM Controllers]({{< relref "ocm-controllers.md" >}}) - Deep Dive into the OCM Controller ecosystem |
|
Great to read and follow! My only comments are about wording and format, only nits. |
| class CV,Blob ocm | ||
| ``` | ||
|
|
||
| To reach the successful deployment status, the following chain of objects has to be reconciled. `Repository` -> `Component` -> `Resource` -> `Deployer`. |
There was a problem hiding this comment.
| To reach the successful deployment status, the following chain of objects has to be reconciled. `Repository` -> `Component` -> `Resource` -> `Deployer`. | |
| To reach the successful deployment status, the following chain of objects has to be reconciled: `Repository` -> `Component` -> `Resource` -> `Deployer`. |
There was a problem hiding this comment.
Considering this is a concept document, this lacks some meat.
Also, I think we should exclude kro from our explanations here. Our controller can and do work standalone. KRO is one of the common use cases, but so is flux or argo, or even kro + flux or argo,
I think to prevent overwhelming users, this concept should be just about the controllers and we could have further sections on how integrate them with other tools.
| This tutorial walks you through deploying a Helm chart from an OCM component version to a Kubernetes cluster | ||
| using the OCM Controllers with kro and Flux. It covers two approaches: |
There was a problem hiding this comment.
I think we need such a tutorial, but this should not be the default "Deploy with Controllers" tutorial. This scenario should be an advanced tutorial building on this one.
| - [Controller environment]({{< relref "setup-controller-environment.md" >}}) set up (OCM Controllers, kro, and Flux) | ||
| - [OCM CLI]({{< relref "ocm-cli-installation.md" >}}) installed | ||
| - Access to an OCI registry (e.g., [ghcr.io](https://docs.github.com/en/packages/learn-github-packages/introduction-to-github-packages)) | ||
| - A GitHub account with a personal access token |
There was a problem hiding this comment.
A basic understanding of KRO and FluxCD (ideally with links to their intro sections)
| Replace the `baseUrl` placeholder with your repository: | ||
|
|
||
| ```shell | ||
| sed -i'' -e "s|OCM_REPO_PLACEHOLDER|$OCM_REPO|" rgd.yaml |
There was a problem hiding this comment.
Maybe envsubst might be better suited for that purpose?
| {{< /step >}} | ||
|
|
||
| {{<callout context="note" title="globalAccess vs direct access" icon="outline/info-circle">}} | ||
| Unlike Part 1, this RGD uses `resource.access.globalAccess.toOCI()` instead of `resource.access.toOCI()`. When the component is transferred with `--copy-resources`, the resources are copied into the target registry and the component descriptor records a _local_ reference to them. The `globalAccess` field resolves the resource through its relocated OCI reference, which is required for the HelmRelease to pull the artifact ( the podinfo image ) from the correct registry. |
There was a problem hiding this comment.
I think this whole section is outdated.
| ocm add cv | ||
| ``` | ||
|
|
||
| Then transfer it to the registry with `--copy-resources`. This copies the referenced OCI artifacts (Helm chart and image) into your registry, which is what enables localization. The component descriptor is updated to point at the new locations: |
There was a problem hiding this comment.
Also, saying it "enables localization" feels weird. It's nothing we'd really like to have. I think even though this is a tutorial, you need to explain (or at least link) to a section that explains the rational about localization.
Maybe that's even worth its own concept.
| {{< /steps >}} | ||
|
|
||
| {{<callout context="note">}} | ||
| If using a private registry, see the [OCM CLI credentials documentation]({{<relref "/docs/concepts/credential-system.md">}}). |
There was a problem hiding this comment.
I think you shouldn't link to a concept section here. The user is trying to work through a tutorial. Link him the https://deploy-preview-761--open-component-model.netlify.app/dev/docs/tutorials/credentials-for-ocm-controllers/ section.
| ## Caching | ||
|
|
||
| Downloaded resource blobs are cached by digest in an LRU cache. If the digest has not changed between reconciliations, the Deployer skips re-downloading and re-applying. This reduces both network traffic and unnecessary applies. | ||
|
|
There was a problem hiding this comment.
Nothing about descriptor caching? That's way more relevant for the overall performance (but maybe that should be explain in the controller concept section.
I think finding a natural way to split the Deployment Controller from the other controllers might become a challenge.
it's my request - it was done, I just do not want the PR
|
This is not a great way to do this. I was trying to do everything in one PR and it made it a giant mess. I'm going to separate this into smaller, more digestible chunks and then we can go from there. |
|
I will have a doc up about the deploy with controllers later today with the suggestions made by all of you. :) Then the rest will come one-by-one :) |
What this PR does / why we need it
Fixes open-component-model/ocm-project#890.
Which issue(s) this PR is related to
Type of content
getting-started/ortutorials/)how-to/)concepts/)reference/)Checklist
Summary by CodeRabbit