Skip to content

Commit 9f15105

Browse files
committed
updates from code review
1 parent 0ff8f15 commit 9f15105

File tree

5 files changed

+44
-39
lines changed

5 files changed

+44
-39
lines changed

applications/wg-easy/Taskfile.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,7 @@ tasks:
185185
desc: Run preflight checks on Helm charts using preflight CLI (use DRY_RUN=true for dry-run)
186186
silent: false
187187
vars:
188-
DRY_RUN:
189-
default: false
188+
DRY_RUN: '{{.DRY_RUN | default "false"}}'
190189
cmds:
191190
- |
192191
PREFLIGHT_FLAGS=""
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{- define "cert-manager.preflight" -}}
2+
apiVersion: troubleshoot.sh/v1beta2
3+
kind: Preflight
4+
metadata:
5+
name: cert-manager-preflights
6+
spec:
7+
analyzers:
8+
# https://github.com/cert-manager/cert-manager/blob/master/deploy/charts/cert-manager/README.template.md#prerequisites
9+
- clusterVersion:
10+
outcomes:
11+
- fail:
12+
when: "< 1.22.0"
13+
message: The application requires at least Kubernetes 1.22.0, and recommends 1.25.0.
14+
uri: https://cert-manager.io/docs/installation/helm/#prerequisites
15+
- warn:
16+
when: "< 1.25.0"
17+
message: Your cluster meets the minimum version of Kubernetes, but we recommend you update to 1.25.0 or later.
18+
uri: https://cert-manager.io/docs/installation/helm/#prerequisites
19+
- pass:
20+
message: Your cluster meets the recommended and required versions of Kubernetes.
21+
{{- end -}}

applications/wg-easy/charts/cert-manager/templates/secret-preflights.yaml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,4 @@ metadata:
77
type: Opaque
88
stringData:
99
preflight.yaml: |
10-
apiVersion: troubleshoot.sh/v1beta2
11-
kind: Preflight
12-
metadata:
13-
name: cert-manager-preflights
14-
spec:
15-
analyzers:
16-
# https://github.com/cert-manager/cert-manager/blob/master/deploy/charts/cert-manager/README.template.md#prerequisites
17-
- clusterVersion:
18-
outcomes:
19-
- fail:
20-
when: "< 1.22.0"
21-
message: The application requires at least Kubernetes 1.22.0, and recommends 1.25.0.
22-
uri: https://cert-manager.io/docs/installation/helm/#prerequisites
23-
- warn:
24-
when: "< 1.25.0"
25-
message: Your cluster meets the minimum version of Kubernetes, but we recommend you update to 1.25.0 or later.
26-
uri: https://cert-manager.io/docs/installation/helm/#prerequisites
27-
- pass:
28-
message: Your cluster meets the recommended and required versions of Kubernetes.
10+
{{ include "cert-manager.preflight" . | indent 4 }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{{- define "wg-easy.preflight" -}}
2+
apiVersion: troubleshoot.sh/v1beta2
3+
kind: Preflight
4+
metadata:
5+
name: wg-easy-preflights
6+
spec:
7+
collectors:
8+
- sysctl:
9+
image: debian:buster-slim
10+
analyzers:
11+
- sysctl:
12+
checkName: IP forwarding enabled
13+
outcomes:
14+
- fail:
15+
when: 'net.ipv4.ip_forward == 0'
16+
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'."
17+
- pass:
18+
when: 'net.ipv4.ip_forward == 1'
19+
message: "IP forwarding is enabled."
20+
{{- end -}}

applications/wg-easy/charts/wg-easy/templates/secret-preflights.yaml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,4 @@ metadata:
77
type: Opaque
88
stringData:
99
preflight.yaml: |
10-
apiVersion: troubleshoot.sh/v1beta2
11-
kind: Preflight
12-
metadata:
13-
name: wg-easy-preflights
14-
spec:
15-
collectors:
16-
- sysctl:
17-
image: debian:buster-slim
18-
analyzers:
19-
- sysctl:
20-
checkName: IP forwarding enabled
21-
outcomes:
22-
- fail:
23-
when: 'net.ipv4.ip_forward == 0'
24-
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'."
25-
- pass:
26-
when: 'net.ipv4.ip_forward == 1'
27-
message: "IP forwarding is enabled."
10+
{{ include "wg-easy.preflight" . | indent 4 }}

0 commit comments

Comments
 (0)