Multinet Static IP Allocation

Open
#567 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
go, kubernetes
Domain
networking

Research direction

Start by reproducing the provided Network, NetworkAttachmentDefinition, and Pod manifests and inspect the reported static-IP CIDR validation error. Trace the CNI handling of the ips annotation and static IPAM configuration, then determine the supported address format and add coverage for the requested persistent allocation behavior.

Written by the indexing model from the issue text.

Description

Is your feature request related to a problem? Please describe.
There are some Telco CNFs that require persistent IP allocation, an example will be the gateway functionality of 5G UPF, whereby UEs require a default gateway to route the IP traffic to the internet/corporate network.

Describe the solution you'd like
Have the following network config:

apiVersion: projectcalico.org/v3
kind: Network
metadata:
  name: green
spec:
  vni: 89
  range: "172.22.0.0/16"
---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
  name: network-green-conf
spec:
  config: |-
    {
      "name": "network-green",
      "cniVersion": "0.3.0",
      "plugins": [
        {
          "type": "calico",
          "log_level": "debug",
          "datastore_type": "kubernetes",
          "mtu": 0,
          "ipam": {
              "type": "static"
          },
          "policy": {
              "type": "k8s"
          },
          "kubernetes": {
              "kubeconfig": "/etc/cni/net.d/calico-kubeconfig"
          },
          "dataplane_options": {
            "type": "grpc",
            "socket": "unix:///var/run/calico/cni-server.sock",
            "network_name": "green"
          }
        }
      ]
    } 

Sample pod template:

apiVersion: v1
kind: Pod
metadata:
  name: memifpod-2
  annotations:
    k8s.v1.cni.cncf.io/networks: |
      [
        {
          "name": "network-green-conf",
          "interface": "memif1",
          "ips": ["172.22.0.1"]
        }
      ]    
spec:
  containers:
  - name: mvpp
    image: calicovpp/vpp:latest
    command: ["tail", "-f", "/dev/null"]
    imagePullPolicy: IfNotPresent
    securityContext:
      privileged: true

Describe alternatives you've considered
I have tried the above context but it's not working, keeps giving errors:

  Warning  FailedCreatePodSandBox  0s    kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container "4fcdac839a327b8d2e455131323df039fbe9051fc5239ff65d6963497c609941" network for pod "memifpod-2": networkPlugin cni failed to set up pod "memifpod-2_default" network: CmdAdd (shim): CNI request failed with status 400: '&{ContainerID:4fcdac839a327b8d2e455131323df039fbe9051fc5239ff65d6963497c609941 Netns:/proc/19355/ns/net IfName:eth0 Args:IgnoreUnknown=1;K8S_POD_NAMESPACE=default;K8S_POD_NAME=memifpod-2;K8S_POD_INFRA_CONTAINER_ID=4fcdac839a327b8d2e455131323df039fbe9051fc5239ff65d6963497c609941 Path: StdinData:[123 34 99 97 112 97 98 105 108 105 116 105 101 115 34 58 123 34 98 97 110 100 119 105 100 116 104 34 58 116 114 117 101 44 34 112 111 114 116 77 97 112 112 105 110 103 115 34 58 116 114 117 101 125 44 34 99 108 117 115 116 101 114 78 101 116 119 111 114 107 34 58 34 47 104 111 115 116 47 101 116 99 47 99 110 105 47 110 101 116 46 100 47 49 48 45 99 97 108 105 99 111 46 99 111 110 102 108 105 115 116 34 44 34 99 110 105 67 111 110 102 105 103 68 105 114 34 58 34 47 104 111 115 116 47 101 116 99 47 99 110 105 47 110 101 116 46 100 34 44 34 99 110 105 86 101 114 115 105 111 110 34 58 34 48 46 51 46 49 34 44 34 108 111 103 76 101 118 101 108 34 58 34 118 101 114 98 111 115 101 34 44 34 108 111 103 84 111 83 116 100 101 114 114 34 58 116 114 117 101 44 34 110 97 109 101 34 58 34 109 117 108 116 117 115 45 99 110 105 45 110 101 116 119 111 114 107 34 44 34 114 117 110 116 105 109 101 67 111 110 102 105 103 34 58 123 34 112 111 114 116 77 97 112 112 105 110 103 115 34 58 91 93 125 44 34 115 111 99 107 101 116 68 105 114 34 58 34 47 114 117 110 47 109 117 108 116 117 115 47 34 44 34 116 121 112 101 34 58 34 109 117 108 116 117 115 45 115 104 105 109 34 44 10 32 32 32 32 34 99 104 114 111 111 116 68 105 114 34 58 32 34 47 104 111 115 116 114 111 111 116 34 44 10 32 32 32 32 34 99 111 110 102 68 105 114 34 58 32 34 47 104 111 115 116 47 101 116 99 47 99 110 105 47 110 101 116 46 100 34 44 10 32 32 32 32 34 108 111 103 84 111 83 116 100 101 114 114 34 58 32 116 114 117 101 44 10 32 32 32 32 34 108 111 103 76 101 118 101 108 34 58 32 34 100 101 98 117 103 34 44 10 32 32 32 32 34 108 111 103 70 105 108 101 34 58 32 34 47 116 109 112 47 109 117 108 116 117 115 46 108 111 103 34 44 10 32 32 32 32 34 98 105 110 68 105 114 34 58 32 34 47 111 112 116 47 99 110 105 47 98 105 110 34 44 10 32 32 32 32 34 99 110 105 68 105 114 34 58 32 34 47 118 97 114 47 108 105 98 47 99 110 105 47 109 117 108 116 117 115 34 44 10 32 32 32 32 34 115 111 99 107 101 116 68 105 114 34 58 32 34 47 104 111 115 116 47 114 117 110 47 109 117 108 116 117 115 47 34 10 125 10]} {ContainerID:4fcdac839a327b8d2e455131323df039fbe9051fc5239ff65d6963497c609941 Netns:/proc/19355/ns/net IfName:eth0 Args:IgnoreUnknown=1;K8S_POD_NAMESPACE=default;K8S_POD_NAME=memifpod-2;K8S_POD_INFRA_CONTAINER_ID=4fcdac839a327b8d2e455131323df039fbe9051fc5239ff65d6963497c609941 Path: StdinData:[123 34 99 97 112 97 98 105 108 105 116 105 101 115 34 58 123 34 98 97 110 100 119 105 100 116 104 34 58 116 114 117 101 44 34 112 111 114 116 77 97 112 112 105 110 103 115 34 58 116 114 117 101 125 44 34 99 108 117 115 116 101 114 78 101 116 119 111 114 107 34 58 34 47 104 111 115 116 47 101 116 99 47 99 110 105 47 110 101 116 46 100 47 49 48 45 99 97 108 105 99 111 46 99 111 110 102 108 105 115 116 34 44 34 99 110 105 67 111 110 102 105 103 68 105 114 34 58 34 47 104 111 115 116 47 101 116 99 47 99 110 105 47 110 101 116 46 100 34 44 34 99 110 105 86 101 114 115 105 111 110 34 58 34 48 46 51 46 49 34 44 34 108 111 103 76 101 118 101 108 34 58 34 118 101 114 98 111 115 101 34 44 34 108 111 103 84 111 83 116 100 101 114 114 34 58 116 114 117 101 44 34 110 97 109 101 34 58 34 109 117 108 116 117 115 45 99 110 105 45 110 101 116 119 111 114 107 34 44 34 114 117 110 116 105 109 101 67 111 110 102 105 103 34 58 123 34 112 111 114 116 77 97 112 112 105 110 103 115 34 58 91 93 125 44 34 115 111 99 107 101 116 68 105 114 34 58 34 47 114 117 110 47 109 117 108 116 117 115 47 34 44 34 116 121 112 101 34 58 34 109 117 108 116 117 115 45 115 104 105 109 34 44 10 32 32 32 32 34 99 104 114 111 111 116 68 105 114 34 58 32 34 47 104 111 115 116 114 111 111 116 34 44 10 32 32 32 32 34 99 111 110 102 68 105 114 34 58 32 34 47 104 111 115 116 47 101 116 99 47 99 110 105 47 110 101 116 46 100 34 44 10 32 32 32 32 34 108 111 103 84 111 83 116 100 101 114 114 34 58 32 116 114 117 101 44 10 32 32 32 32 34 108 111 103 76 101 118 101 108 34 58 32 34 100 101 98 117 103 34 44 10 32 32 32 32 34 108 111 103 70 105 108 101 34 58 32 34 47 116 109 112 47 109 117 108 116 117 115 46 108 111 103 34 44 10 32 32 32 32 34 98 105 110 68 105 114 34 58 32 34 47 111 112 116 47 99 110 105 47 98 105 110 34 44 10 32 32 32 32 34 99 110 105 68 105 114 34 58 32 34 47 118 97 114 47 108 105 98 47 99 110 105 47 109 117 108 116 117 115 34 44 10 32 32 32 32 34 115 111 99 107 101 116 68 105 114 34 58 32 34 47 104 111 115 116 47 114 117 110 47 109 117 108 116 117 115 47 34 10 125 10]} ERRORED: error configuring pod [default/memifpod-2] networking: [default/memifpod-2/:network-green]: error adding container to network "network-green": plugin type="calico" failed (add): invalid CIDR 172.22.0.1: invalid CIDR address: 172.22.0.1

Additional context
None.

Dominant language
Go
Stars
172
Forks
47
Avg merge
4d 23h
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from projectcalico/vpp-dataplane

All issues in projectcalico/vpp-dataplane

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.