Skip to content

Commit df17220

Browse files
committed
fix: iptable persistent removed from packages
1 parent fa0daa2 commit df17220

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

v1/providers/nebius/instance.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1762,7 +1762,6 @@ func generateCloudInitUserData(publicKey string, firewallRules v1.FirewallRules)
17621762
script := `#cloud-config
17631763
packages:
17641764
- ufw
1765-
- iptables-persistent
17661765
`
17671766

17681767
// Add SSH key configuration if provided
@@ -1794,6 +1793,13 @@ packages:
17941793
// accessible from the internet by default.
17951794
commands = append(commands, generateIPTablesCommands()...)
17961795

1796+
// Install iptables-persistent here (in runcmd, after UFW is configured) rather than
1797+
// in the packages: directive. Installing it as a package would start netfilter-persistent.service
1798+
// immediately at first boot, which races with ufw.service — netfilter-persistent flushes
1799+
// UFW's rules before UFW finishes loading them (Launchpad bug #1987227). By installing
1800+
// it here, the service only starts after UFW is already set up and the drop-in is in place.
1801+
commands = append(commands, "DEBIAN_FRONTEND=noninteractive apt-get install -y iptables-persistent")
1802+
17971803
// Save the complete iptables state (UFW chains + DOCKER-USER rules) so it
17981804
// survives instance stop/start cycles. Cloud-init runcmd only executes on
17991805
// first boot; on subsequent boots netfilter-persistent restores this snapshot,

0 commit comments

Comments
 (0)