← Back to Pull requests

add kata-dan-cni for directly attachable networking #1

Closed
unknown closed this pull request without merging on Nov 17, 2026 03:04 UTC
View on GitHub
unknown unknown commented on Nov 12, 2026 17:34 UTC
Author

Kata Containers' Directly Attachable Network (DAN) allows Kata VMs to use host network devices directly.
Kata runtime-rs reads DAN JSON files named after sandbox IDs, creates VM network devices, and configures
MAC addresses, IP addresses, routes, and other network settings inside the guest. Creating a regular
veth first and then a TAP using the same OVN iface-id can cause port contention and resource cleanup
conflicts.

This PR adds kata-dan-cni, a standalone Rust CNI tool that provides DAN networking for Kata Containers.
It reads existing network allocations from Kube-OVN, creates host TAP devices, configures their OVS
bindings, and generates DAN JSON files named after sandbox IDs. Ordinary Pods are delegated to the
existing Kube-OVN CNI plugin.

The tool supports CNI ADD, DEL, basic CHECK, and VERSION. It provides Provider/backend abstractions,
a Fake Provider, and scripts for DaemonSet installation, credential synchronization, and uninstallation.

Related: kata-containers/kata-containers#14153

Testing

Test environment

  • Ubuntu 22.04.5, amd64

  • Kubernetes / containerd: v1.31.14 / 2.1.4

  • Kube-OVN: v1.16.2

  • OVS / OVN: 3.5.5 / 25.03.4

  • Kata: runtime-rs 4.0.0, QEMU
  • 1. Ordinary Pod

    apiVersion: v1
    kind: Namespace
    metadata:
      name: kata-dan-test
    ---
    apiVersion: v1
    kind: Pod
    metadata:
      name: normal-pod
      namespace: kata-dan-test
      labels:
        app: normal-pod
    spec:
      containers:
        - name: http
          image: busybox:1.36.1
          command:
            - sh
            - -ec
            - |
              mkdir -p /www
              echo normal-pod > /www/index.html
              exec httpd -f -p 8080 -h /www
    

    Test result:

    The Pod reached Running and Ready. Networking was delegated to the existing Kube-OVN CNI plugin,
    and no DAN JSON file was generated.

    2. DAN Pod

    apiVersion: v1
    kind: Pod
    metadata:
      name: kata-dan-pod
      namespace: kata-dan-test
      annotations:
        networking.katacontainers.io/dan: "true"
    spec:
      runtimeClassName: kata-qemu-runtime-rs
      containers:
        - name: http
          image: busybox:1.36.1
          command:
            - sh
            - -ec
            - |
              mkdir -p /www
              echo kata-dan-pod > /www/index.html
              exec httpd -f -p 8080 -h /www
    

    Generated DAN JSON:

    {
      "devices": [
        {
          "device": {
            "queue_num": 1,
            "tap_name": "kdtcfe7cded347f",
            "type": "host-tap"
          },
          "guest_mac": "ea:d2:01:15:98:9f",
          "name": "eth0",
          "network_info": {
            "interface": {
              "flags": 0,
              "ip_addresses": [
                "10.16.0.6/16",
                "fd00:10:16::6/112"
              ],
              "mtu": 1400,
              "ntype": "tuntap"
            },
            "neighbors": [],
            "routes": [
              {
                "dest": "0.0.0.0/0",
                "gateway": "10.16.0.1"
              },
              {
                "dest": "::/0",
                "gateway": "fd00:10:16::1"
              }
            ]
          }
        }
      ],
      "netns": null
    }
    

    Test result:

    The Pod reached Running and Ready. The host TAP device was attached to br-int.

    Diff: 382 lines (+286 / -96) across 4 files Reviewer: l8huang Review duration: 6329m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.43 · 382 lines diff across 4 files
    0.43
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.356
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 43.0% (MEDIUM) · Higher = larger blast radius
    43.0%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 17.0% · Safe to merge
    17.0%