Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD FOR 1.104.0 RELEASE] note about KOTS support bundle spec discovery #1582

Merged
merged 7 commits into from
Nov 7, 2023

Conversation

cbodonnell
Copy link
Contributor

Clarifying note based on questions in Slack https://replicated.slack.com/archives/C02TQTV9G2V/p1698956150308879.

Support was added to KOTS for the troubleshoot.sh/kind label in replicatedhq/kots#4113

@cbodonnell cbodonnell requested a review from a team as a code owner November 3, 2023 13:31
Copy link

netlify bot commented Nov 3, 2023

Deploy Preview for replicated-docs ready!

Name Link
🔨 Latest commit 440f895
🔍 Latest deploy log https://app.netlify.com/sites/replicated-docs/deploys/654a5af1b4da9400089c35df
😎 Deploy Preview https://deploy-preview-1582--replicated-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Nov 3, 2023

Deploy Preview for replicated-docs-upgrade ready!

Name Link
🔨 Latest commit 440f895
🔍 Latest deploy log https://app.netlify.com/sites/replicated-docs-upgrade/deploys/654a5af1e9ae91000928699b
😎 Deploy Preview https://deploy-preview-1582--replicated-docs-upgrade.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@replicated-ci replicated-ci added type::docs Improvements or additions to documentation type::feature labels Nov 3, 2023
@cbodonnell cbodonnell requested a review from ajp-io November 3, 2023 13:32
@ajp-io
Copy link
Member

ajp-io commented Nov 3, 2023

@replicatedhq/replicated-docs We want to mention that KOTS will also consume support bundles stored as part of Helm charts. I see that the Helm preflight docs already mention that KOTS will do this, so Craig is adding something to the support bundle docs. But it's in a different place. Would you mind just looking through these two pages and making sure they both consistently communicate that KOTS can use preflights and support bundles in Helm charts?


The following examples show some possible CLI commands to generate a support bundle for one or more specifications and locations:
For installations with the Helm CLI or with KOTS v1.104.0 and later, specifications can be automatically discovered in Secrets or ConfigMap objects in the cluster using the `--load-cluster-specs` flag with the `kubectl support-bundle`. Alternatively, for installations with the Helm CLI or with KOTS versions earlier than 1.104.0, specifications can be provided from YAML files in the local directory or from a URL.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarify that --load-cluster-specs flag applies to Helm CLI installs and to KOTS v1.104.0 or later.

Also made some edits to this description overall because I found it a little difficult to follow before

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be read to say that 1.104.0 and later can't use YAML files or a URL, which isn't true.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good call


Next, define the support bundle specification by adding collectors and analyzers. For more information, see [Define the Support Bundle Specification](#spec).

### Create a SupportBundle Custom Resource

If you do not want to use Secrets, you can create a SupportBundle custom resource instead. Helm templates are supported when the specification is distributed using an OCI registry.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Helm templates are supported when the specification is distributed using an OCI registry.

I didn't see anything in the output of kubectl support-bundle --help or in the troubleshoot docs that indicated you could provide a link to the OCI registry. I think this might have been accidentally conflated with the kubectl preflight option to point to an OCI registry

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An engineer would know better than I do. You could be right. I know you can point to an HTTP endpoint, but maybe we modified this to include an OCI registry too (like back when we were first working on Helm CLI support).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Diamon says "Looks like the answer is yes". so I'll add this statement back in and then take the same approach to investigate further as part of a follow up story

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, added this info back in with an example of what this is talking about:

:::note
For specifications created in a SupportBundle custom resource, Helm templates are supported only when the support bundle is generated from a link to the specification at an OCI registry. For example, `kubectl support-bundle oci://my.oci.registry/image`.
:::

Figured this could be a placeholder, but still needs to be revisited to fully document generating a SB from a spec at an OCI registry URL


Next, define the support bundle specification by adding collectors and analyzers. For more information, see [Define the Support Bundle Specification](#spec).

### Create a SupportBundle Custom Resource

If you do not want to use Secrets, you can create a SupportBundle custom resource instead. Helm templates are supported when the specification is distributed using an OCI registry.
If you do not want to use Secrets or ConfigMaps, you can create a SupportBundle custom resource instead.

Create a SupportBundle custom resource (`kind: SupportBundle`) using the following basic support bundle template. For more information about this custom resource, see [Preflight and Support Bundle](/reference/custom-resource-preflight).
Copy link
Contributor

@paigecalvert paigecalvert Nov 3, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ Is there any requirement that this spec is wrapped in a template so that it's deployed to the cluster? or does that only matter for the preflight specs? It's not really clear to me, if I'm trying to distribute with the Helm CLI, what I would do with this SupportBundle custom resource. Add it to my templates? Just save it in a YAML file and email it to my customer as needed?

here's the corresponding info about defining a Preflight custom resource for Helm charts for reference: https://docs.replicated.com/vendor/preflight-helm-defining#create-a-preflight-custom-resource

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should clarify that renderpreflights thing. The name itself is ambiguous—I assume it's a name we chose and not a hardcoded string, but the name isn't obvious to me. Maybe this lets you skip preflights. My guess is that it lets you skip preflights somehow, so we don't need it for support bundles, but we should confirm and clarify in that doc too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The renderpreflights thing is indeed just an example string. The purpose of it is: "If you use this input kind, you must use conditional statements because the custom resource definition is not installed in the cluster." As in, if you want to create a preflight definition in a Preflight custom resource manifest and add it to your templates (instead of creating a preflight spec in a Secret or ConfigMap), then you need to wrap it in a conditional statement that evaluates to true so that the preflight custom resource is installed in the cluster. (I think you can always skip preflights for Helm CLI installs since it requires running a separate command anyway, right?)

What I wasn't understanding was why that same thing doesn't seem to apply to this support bundle spec. Like, is the spec supposed to get installed to the cluster?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still trying to get my head fully around that. If the CRD isn't installed, what does the value do? I don't quite see how it's any different.

But I get your point about why would that not also be needed for support bundles.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah good point. Maybe this option can just be removed from the docs all together if it's not recommended and added to a community article instead...I'll add this to a new story to investigate more fully.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ajp-io
ajp-io previously approved these changes Nov 7, 2023
Copy link
Member

@ajp-io ajp-io left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed one small typo, but otherwise I approve. I think we can revisit these docs as part of our review of KOTS vs. Helm docs anyway.

docs/partials/support-bundles/_generate-bundle.mdx Outdated Show resolved Hide resolved
@paigecalvert paigecalvert merged commit eefa165 into main Nov 7, 2023
3 checks passed
@paigecalvert paigecalvert deleted the cbo/kots-discover-support-bundle-specs branch November 7, 2023 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::docs Improvements or additions to documentation type::feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants