Skip to content

Commit

Permalink
feat: add preflight for ip forwarding (#1449)
Browse files Browse the repository at this point in the history
we require users to manually enable ip forwarding on their nodes before
installing. this preflight checks if ip forwarding is enabled and fails
if it is not.
  • Loading branch information
ricardomaraschini authored Nov 5, 2024
1 parent c8ba6ed commit 65f3996
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkg/preflights/host-preflight.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ spec:
exclude: '{{ eq .GlobalCIDR.CIDR "" }}'
CIDRRangeAlloc: '{{ .GlobalCIDR.CIDR }}'
desiredCIDR: {{.GlobalCIDR.Size}}
- run:
collectorName: "kernel-parameters"
command: "sysctl"
args: ["-a"]
analyzers:
- cpu:
checkName: CPU
Expand Down Expand Up @@ -834,3 +838,14 @@ spec:
- pass:
when: "a-subnet-is-available"
message: Specified CIDR is available.
- textAnalyze:
checkName: IP forwarding
fileName: host-collectors/run-host/kernel-parameters.txt
regex: 'net.ipv4.ip_forward = 1'
outcomes:
- pass:
when: "true"
message: IP forwarding is enabled.
- fail:
when: "false"
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'.

0 comments on commit 65f3996

Please sign in to comment.