-
Notifications
You must be signed in to change notification settings - Fork 26
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
Changes from 2 commits
a6420d5
c91f545
0ffb3a2
d0c350d
38dd21a
904ba2f
440f895
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,45 @@ | ||
Support bundles are generated from one or more support bundle specifications. Specification locations include YAML manifest files in the cluster, URLs, and Secrets or ConfigMap objects embedded in a Kubernetes cluster. For more information, see [Collecting a Support Bundle](https://troubleshoot.sh/docs/support-bundle/collecting/) and [Discover Cluster Specs](https://troubleshoot.sh/docs/support-bundle/discover-cluster-specs/) in the Troubleshoot documentation. | ||
Support bundles are generated by providing one or more support bundle specifications with the `kubectl support-bundle` command. | ||
|
||
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. | ||
|
||
- Automatically discover specifications in the cluster that are contained in Secrets or ConfigMaps: | ||
For a complete list of options with the `kubectl support-bundle` command, run `kubectl support-bundle --help`. For more information, see [Collecting a Support Bundle](https://troubleshoot.sh/docs/support-bundle/collecting/) and [Discover Cluster Specs](https://troubleshoot.sh/docs/support-bundle/discover-cluster-specs/) in the Troubleshoot documentation. | ||
|
||
The following lists some possible uses of the `kubectl support-bundle` CLI command to generate a support bundle from one or more specifications: | ||
|
||
- Discover all specifications defined in Secrets or ConfigMaps in the cluster: | ||
|
||
```bash | ||
kubectl support-bundle --load-cluster-specs | ||
``` | ||
- Automatically discover specifications found in the cluster that match a custom label: | ||
|
||
:::note | ||
The `--load-cluster-specs` flag is supported for Helm CLI installations and KOTS v1.104.0 or later. | ||
::: | ||
|
||
- Discover all specifications defined in Secrets or ConfigMaps in the cluster that match a custom label: | ||
|
||
```bash | ||
kubectl support-bundle --load-cluster-specs -l LABEL | ||
``` | ||
|
||
Replace `LABEL` with the label name. | ||
Where `LABEL` is the name of the custom label. | ||
|
||
- Using one or more files: | ||
- Provide one or more files that contain support bundle specifications: | ||
|
||
```bash | ||
kubectl support-bundle ./PATH_TO_FILE1 ./PATH_TO_FILE2 ./PATH_TO_FILE3 | ||
``` | ||
|
||
Replace `PATH_TO_FILE` with the path and YAML file name for each file. | ||
Where `PATH_TO_FILE` is the path and YAML file name for each file. | ||
|
||
- Using a URL and a specification in the cluster: | ||
- Provide one specification that is located at a URL and another specification located in the local directory: | ||
|
||
```bash | ||
kubectl support-bundle URL \ | ||
./PATH_TO_FILE | ||
``` | ||
|
||
Replace: | ||
Where: | ||
|
||
- `URL` with the online specification location provided by your vendor | ||
- `PATH_TO_FILE` with the path and YAML file name | ||
- `URL` is the URL where the specification is located | ||
- `PATH_TO_FILE` is the path and YAML file name |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,9 @@ import RedactorsAbout from "../partials/redactors/_redactors-about.mdx" | |
import PreflightSbHelmTemplates from "../partials/preflights/_preflight-sb-helm-templates.mdx" | ||
|
||
|
||
# Customize Support Bundles for Helm Installations | ||
# Customize Support Bundles for Helm Charts | ||
|
||
This topic provides a basic understanding and some key considerations about support bundle specifications for Helm installations to help guide you in defining them for your application. | ||
This topic provides a basic understanding and some key considerations about support bundle specifications for Helm charts to help guide you in defining them for your application. The content in this topic applies to Helm chart-based applications installed with the Helm CLI or with Replicated KOTS v1.104.0 and later. | ||
paigecalvert marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## About Support Bundles | ||
|
||
|
@@ -23,14 +23,16 @@ Customizing a support bundle is unique to your application and depends on what k | |
|
||
## Choose an Input Kind | ||
|
||
You can create support bundle specifications using the following kinds: | ||
Support bundles are generated with the open source support-bundle kubectl plugin by running `kubectl support-bundle`. For more information about the support-bundle plugin, see [Getting Started](https://troubleshoot.sh/docs/) in the open source Troubleshoot documentation. | ||
|
||
- Secret (`kind: Secret`) | ||
- SupportBundle custom resource (`kind: SupportBundle`) | ||
The support-bundle plugin requires a support bundle specification as input. You can define support bundle specifications in using the following kinds of resources: | ||
|
||
- Kubernetes Secret or ConfigMap with `label.troubleshoot.sh/kind: support-bundle` | ||
- SupportBundle custom resource (`apiVersion: troubleshoot.sh/v1beta2` and `kind: SupportBundle`) | ||
|
||
### Create a Secret (Recommended) | ||
|
||
Replicated recommends using Secrets to contain a support bundle specifications in your Helm chart. This method allows customers to automatically discover and generate a support bundle without specifying a long URL. Using Secrets also allows specifications to be templated using information in the `values.yaml` file. | ||
Replicated recommends defining support bundle specifications in Secrets in your Helm chart templates. For installations with the Helm CLI or with KOTS v1.104.0 and later, defining specifications in Secrets allows your users to automatically discover and generate a support bundle without needing to provide multiple files or specify a long URL with the `kubectl support-bundle` command. Using Secrets also allows specifications to be templated using information in the `values.yaml` file. | ||
paigecalvert marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
<ConfigmapNote/> | ||
|
||
|
@@ -65,13 +67,13 @@ To create a Secret for the support bundle specification: | |
analyzers: [] | ||
``` | ||
|
||
1. Add the Secret to your Helm chart `templates/` directory. | ||
1. Add the Secret to your Helm chart `templates/` directory. | ||
|
||
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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Diamon's looking into it: https://replicated.slack.com/archives/C016DU6CXNE/p1699304942774859 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:
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 |
||
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). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we should clarify that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Story to investigate and update the docs for both preflight and SB specs: https://app.shortcut.com/replicated/story/92865/update-docs-about-support-bundle-preflight-spec-discovery-to-clarify-custom-resource-option |
||
|
||
|
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good call