-
Notifications
You must be signed in to change notification settings - Fork 4
feat: wg-easy add preflights #59
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
Show all changes
5 commits
Select commit
Hold shift + click to select a range
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
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 |
|---|---|---|
|
|
@@ -52,3 +52,4 @@ applications/wg-easy/release/ | |
| .aider* | ||
| # SpecStory explanation file | ||
| .specstory/.what-is-this.md | ||
| *.tar.gz | ||
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
21 changes: 21 additions & 0 deletions
21
applications/wg-easy/charts/cert-manager/templates/_preflight.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,21 @@ | ||
| {{- define "cert-manager.preflight" -}} | ||
| apiVersion: troubleshoot.sh/v1beta2 | ||
| kind: Preflight | ||
| metadata: | ||
| name: cert-manager-preflights | ||
| spec: | ||
| analyzers: | ||
| # https://github.com/cert-manager/cert-manager/blob/master/deploy/charts/cert-manager/README.template.md#prerequisites | ||
| - clusterVersion: | ||
| outcomes: | ||
| - fail: | ||
| when: "< 1.22.0" | ||
| message: The application requires at least Kubernetes 1.22.0, and recommends 1.25.0. | ||
| uri: https://cert-manager.io/docs/installation/helm/#prerequisites | ||
| - warn: | ||
| when: "< 1.25.0" | ||
| message: Your cluster meets the minimum version of Kubernetes, but we recommend you update to 1.25.0 or later. | ||
| uri: https://cert-manager.io/docs/installation/helm/#prerequisites | ||
| - pass: | ||
| message: Your cluster meets the recommended and required versions of Kubernetes. | ||
| {{- end -}} |
10 changes: 10 additions & 0 deletions
10
applications/wg-easy/charts/cert-manager/templates/secret-preflights.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-preflights | ||
| labels: | ||
| troubleshoot.sh/kind: preflight | ||
| type: Opaque | ||
| stringData: | ||
| preflight.yaml: | | ||
| {{ include "cert-manager.preflight" . | indent 4 }} |
20 changes: 20 additions & 0 deletions
20
applications/wg-easy/charts/wg-easy/templates/_preflight.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,20 @@ | ||
| {{- define "wg-easy.preflight" -}} | ||
| apiVersion: troubleshoot.sh/v1beta2 | ||
| kind: Preflight | ||
| metadata: | ||
| name: wg-easy-preflights | ||
| spec: | ||
| collectors: | ||
| - 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-preflights.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-preflights | ||
| labels: | ||
| troubleshoot.sh/kind: preflight | ||
| type: Opaque | ||
| stringData: | ||
| preflight.yaml: | | ||
| {{ include "wg-easy.preflight" . | indent 4 }} |
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
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
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.
I can't imagine we actually want to support setting an ENV for DRY_RUN which is very specific to this one task and not something you likely want set permanently.
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.
yes I think the variable is already scoped locally to the
helm-preflighttask only.I committed the suggestion but it looks like it is not valid Taskfile syntax
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.
Ok so the syntax wasn't correct but it can still be done can't it?
Or something like that?
I'm asking why you're explicitly making a dynamic variable when you don't need it to be dynamic. I think you're copying a pattern that we setup when we were setting global variables and importing environments but I don't think it is necessary here.
Maybe I'm just misunderstanding Taskfile and this isn't possible or the dynamic nature of using "{{.DRY_RUN}}" provides some value that I'm not aware of. Does including "{{.DRY_RUN}}" provide some value or is that the only way to set a variable?