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

Add parameterize SupportBundle spec support #1556

Closed
nashtsai opened this issue Jun 1, 2024 · 2 comments
Closed

Add parameterize SupportBundle spec support #1556

nashtsai opened this issue Jun 1, 2024 · 2 comments

Comments

@nashtsai
Copy link

nashtsai commented Jun 1, 2024

Describe the rationale for the suggested feature.

There are a number of collectors that required parameterize values, i.e., helm, for every different input value, it requires us generating new supportbundle yaml from a template, which is rather tedious.

Describe the feature

Have CLI tool accept key-value args and SupportBundle spec support template syntax

# file: helm-collector.yaml
apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
  name: sample
spec:
  collectors:
    - helm:
        # support templating, i.e., helm/go 
        releaseName: {{ .Values.releaseName }}
        # if not specified, scan all namespaces
        {{- if .Values.namespace }}
        namespace: {{  .Values.namespace }}
        {{- end }}

Run CLI command as:

kubectl support-bundle --template helm-collector.yaml --set releaseName=mysql-1692919203

Expecting same result as running following SupportBundle spec

apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
  name: sample
spec:
  collectors:
    - helm:
        releaseName: mysql-1692919203

Describe alternatives you've considered

Wrap support-bundle plugin with support-bundle-template python script and handle template rending in python.

Additional context

Add additional context about the feature request. If the change is substantial, consider attaching files to the issue outlining architectural changes, data flows, file formats etc., anything that helps describe the requested change.

@banjoh
Copy link
Member

banjoh commented Jun 3, 2024

This feature has been previously asked for. The solution we settled for relies on helm CLI performing template evaluation and producing an output that troubleshoot.sh tools would consume. In your example above, the command that would achieve the same results would look like below

helm template my-release ./my-chart --set releaseName=mysql-1692919203 | kubectl support-bundle -

@xavpaice
Copy link
Member

I believe the issue has been answered and so will close this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants