Skip to content

Conversation

@mereta
Copy link

@mereta mereta commented Jul 10, 2025

Reason for Change:
Updates iptables to legacy fix crashloopbackoffs in CBL-Mariner/Linux nodepools.

Issue Fixed:
NPM's Ubuntu base image was recently updated to 24.04 from 20.04 as the older version was EOL (see: #3743). There was a behavioral change between the 2 Ubuntu versions that required NPM to specify legacy for its Iptables.

Error: failed to create dataplane with error Operation [BootupDataplane] failed with error code [999], full cmd [], full error failed to reset policy dataplane: Operation [BootupPolicyManager] failed with error code [999], full cmd [], full error failed to bootup policy manager: failed to detect iptables version: unable to locate which iptables version kube proxy is using

Requirements:

Clone of - #3782

Notes:

rayaisaiah and others added 8 commits June 18, 2025 13:46
Copilot AI review requested due to automatic review settings July 10, 2025 11:18
@mereta mereta requested review from a team as code owners July 10, 2025 11:18
@mereta mereta requested a review from rayaisaiah July 10, 2025 11:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes crashloopbackoffs in CBL-Mariner/Linux nodepools by updating NPM to use iptables-legacy commands instead of the default iptables commands. The change addresses a behavioral difference between Ubuntu 20.04 and 24.04, where the base image was recently updated to Ubuntu 24.04.

Key changes:

  • Updates iptables command constants to use legacy variants
  • Updates all test files to reflect the new legacy command usage
  • Updates base Docker image from Ubuntu 20.04 to 24.04 with specific package versions

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
npm/util/const.go Updates iptables command constants to use legacy variants (iptables-legacy, iptables-legacy-save, iptables-legacy-restore)
npm/pkg/dataplane/policies/testutils_linux.go Updates test expectations to use legacy iptables commands
npm/pkg/dataplane/policies/chain-management_linux_test.go Updates all test cases to expect legacy iptables commands instead of standard ones
npm/linux.Dockerfile Updates base image to Ubuntu 24.04 and pins specific package versions for security updates
hack/aks/Makefile Changes IP tag configuration from test to non-prod environment
go.mod Updates mapstructure dependency version
FROM mcr.microsoft.com/mirror/docker/library/ubuntu:24.04 as linux
COPY --from=builder /usr/local/bin/azure-npm /usr/bin/azure-npm
RUN apt-get update && apt-get install -y iptables ipset ca-certificates && apt-get autoremove -y && apt-get clean
RUN apt-get update && apt-get install -y libsystemd0=255.4-1ubuntu8.8 libudev1=255.4-1ubuntu8.8 libpam-modules=1.5.3-5ubuntu5.4 libpam-modules-bin=1.5.3-5ubuntu5.4 libpam-runtime=1.5.3-5ubuntu5.4 libpam0g=1.5.3-5ubuntu5.4 iptables ipset ca-certificates && apt-get autoremove -y && apt-get clean
Copy link

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The package installation command is very long and hard to read. Consider breaking it into multiple lines or using a separate package list for better maintainability.

Suggested change
RUN apt-get update && apt-get install -y libsystemd0=255.4-1ubuntu8.8 libudev1=255.4-1ubuntu8.8 libpam-modules=1.5.3-5ubuntu5.4 libpam-modules-bin=1.5.3-5ubuntu5.4 libpam-runtime=1.5.3-5ubuntu5.4 libpam0g=1.5.3-5ubuntu5.4 iptables ipset ca-certificates && apt-get autoremove -y && apt-get clean
RUN apt-get update && apt-get install -y \
libsystemd0=255.4-1ubuntu8.8 \
libudev1=255.4-1ubuntu8.8 \
libpam-modules=1.5.3-5ubuntu5.4 \
libpam-modules-bin=1.5.3-5ubuntu5.4 \
libpam-runtime=1.5.3-5ubuntu5.4 \
libpam0g=1.5.3-5ubuntu5.4 \
iptables \
ipset \
ca-certificates && \
apt-get autoremove -y && \
apt-get clean
Copilot uses AI. Check for mistakes.
VM_SIZE ?= Standard_B2s
VM_SIZE_WIN ?= Standard_B2s
IP_TAG ?= FirstPartyUsage=/DelegatedNetworkControllerTest
IP_TAG ?= FirstPartyUsage=/NonProd
Copy link

Copilot AI Jul 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change from '/DelegatedNetworkControllerTest' to '/NonProd' appears unrelated to the main iptables fix. This configuration change should be documented or moved to a separate commit.

Suggested change
IP_TAG ?= FirstPartyUsage=/NonProd
IP_TAG ?= FirstPartyUsage=/DelegatedNetworkControllerTest
Copilot uses AI. Check for mistakes.
@mereta mereta closed this Jul 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants