Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- define "cert-manager.supportbundle" -}}
Copy link
Member

Choose a reason for hiding this comment

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

Nice approach of using tpl helpers. It makes editing the spec easier and less error prone such as getting indentations wrong.

Something to consider is adding a way to test a spec is valid. Just rendering it using support-bundle --dry-run should suffice. If you'd like, you can compare the number of collectors & analysers from the dry run output with an expected number.

Copy link
Member

Choose a reason for hiding this comment

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

The test would then be added to the CI workflow once #69 is merged

Copy link
Member Author

Choose a reason for hiding this comment

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

Cool, I'll have a think about testing in a future PR. a common testing framework for "does my support bundle do what I thought it did" would be nice.

apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
name: cert-manager-supportbundle
spec:
collectors:
- logs:
namespace: {{ .Release.Namespace }}
selector:
- app.kubernetes.io/instance=cert-manager
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: Secret
metadata:
name: cert-manager-supportbundle
labels:
troubleshoot.sh/kind: support-bundle
type: Opaque
stringData:
support-bundle-spec: |
{{ include "cert-manager.supportbundle" . | indent 4 }}
12 changes: 12 additions & 0 deletions applications/wg-easy/charts/traefik/templates/_supportbundle.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- define "traefik.supportbundle" -}}
apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
name: traefik-supportbundle
spec:
collectors:
- logs:
namespace: {{ .Release.Namespace }}
selector:
- app.kubernetes.io/name=traefik
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: Secret
metadata:
name: traefik-supportbundle
labels:
troubleshoot.sh/kind: support-bundle
type: Opaque
stringData:
support-bundle-spec: |
{{ include "traefik.supportbundle" . | indent 4 }}
24 changes: 24 additions & 0 deletions applications/wg-easy/charts/wg-easy/templates/_supportbundle.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{{- define "wg-easy.supportbundle" -}}
apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
name: wg-easy-supportbundle
spec:
collectors:
- logs:
namespace: {{ .Release.Namespace }}
selector:
- app.kubernetes.io/name=wg-easy
- sysctl:
image: debian:buster-slim
analyzers:
- sysctl:
checkName: IP forwarding enabled
outcomes:
- fail:
when: 'net.ipv4.ip_forward == 0'
message: "IP forwarding must be enabled. To enable it, edit /etc/sysctl.conf, add or uncomment the line 'net.ipv4.ip_forward=1', and run 'sudo sysctl -p'."
- pass:
when: 'net.ipv4.ip_forward == 1'
message: "IP forwarding is enabled."
{{- end -}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: v1
kind: Secret
metadata:
name: wg-easy-supportbundle
labels:
troubleshoot.sh/kind: support-bundle
type: Opaque
stringData:
support-bundle-spec: |
{{ include "wg-easy.supportbundle" . | indent 4 }}
Loading