Skip to content

Comments

fix: Adding ipv6 check on the node init function#10

Open
MitchLewis930 wants to merge 1 commit intopr_050_beforefrom
pr_050_after
Open

fix: Adding ipv6 check on the node init function#10
MitchLewis930 wants to merge 1 commit intopr_050_beforefrom
pr_050_after

Conversation

@MitchLewis930
Copy link

PR_050

Cilium pods on a single stack cluster were failing when ipv6 was enabled.
The change would make sure that if the underlying node does not have ipv6
configuration enabled it would fail even if KPR is disabled.Earlier, if KPR
is enabled, the node would not see a fatal error.

Signed-off-by: Vipul Singh <singhvipul@microsoft.com>
@greptile-apps
Copy link

greptile-apps bot commented Jan 30, 2026

Greptile Overview

Greptile Summary

Added early validation in WaitForNodeInformation to check if a node has an IPv6 address when EnableIPv6 is configured. Previously, Cilium pods would fail later in the initialization process on single-stack (IPv4-only) clusters when IPv6 was enabled in the configuration, making troubleshooting more difficult. The new check returns an explicit error early, preventing pods from starting when the node lacks required IPv6 support.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change adds a targeted validation check that fails fast when IPv6 is enabled but the node lacks an IPv6 address. The logic is straightforward, follows existing patterns in the codebase (similar to wireguard agent validation), and addresses a real operational issue where Cilium pods would fail later with less clear error messages.
  • No files require special attention

Important Files Changed

Filename Overview
daemon/k8s/init.go Added IPv6 address validation to prevent Cilium pods from failing on single-stack clusters when IPv6 is enabled

Sequence Diagram

sequenceDiagram
    participant API as Kubernetes API
    participant WNI as WaitForNodeInformation
    participant RNI as retrieveNodeInformation
    participant Node as Node Object
    participant Config as option.Config
    participant Logger as Log
    
    WNI->>Config: Check nodeName
    alt nodeName is empty
        WNI-->>WNI: Return nil (skip validation)
    else nodeName exists
        WNI->>RNI: retrieveNodeInformation(ctx, log, localNode, localCiliumNode)
        RNI->>API: Watch for Node/CiliumNode events
        API-->>RNI: Return node resource
        RNI-->>WNI: Return Node object
        
        alt Node object received
            WNI->>Node: GetNodeIP(false) - IPv4
            Node-->>WNI: nodeIP4
            WNI->>Node: GetNodeIP(true) - IPv6
            Node-->>WNI: nodeIP6
            WNI->>Logger: Log node information
            
            Note over WNI,Config: New IPv6 validation check
            WNI->>Config: Check EnableIPv6
            alt EnableIPv6 && nodeIP6 == nil
                WNI->>Logger: Error: No IPv6 support
                WNI-->>WNI: Return error (node has no IPv6)
            else IPv6 check passes
                WNI->>WNI: useNodeCIDR(n)
                WNI-->>WNI: Success
            end
        else Node object not received
            alt CIDR required
                WNI-->>WNI: Return error (unable to derive PodCIDR)
            else CIDR not required
                WNI-->>WNI: Success
            end
        end
    end
Loading

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file reviewed, no comments

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants