-
Notifications
You must be signed in to change notification settings - Fork 4
Add log basic support bundle specs #72
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
applications/wg-easy/charts/cert-manager/templates/_supportbundle.tpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{{- define "cert-manager.supportbundle" -}} | ||
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 -}} |
10 changes: 10 additions & 0 deletions
10
applications/wg-easy/charts/cert-manager/templates/secret-supportbundle.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
12
applications/wg-easy/charts/traefik/templates/_supportbundle.tpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 -}} |
10 changes: 10 additions & 0 deletions
10
applications/wg-easy/charts/traefik/templates/secret-supportbundle.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
24
applications/wg-easy/charts/wg-easy/templates/_supportbundle.tpl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 -}} |
10 changes: 10 additions & 0 deletions
10
applications/wg-easy/charts/wg-easy/templates/secret-supportbundle.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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.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.
The test would then be added to the CI workflow once #69 is merged
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.
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.