Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] route entry is not added when vrf table is used #300

Open
yagosys opened this issue Feb 10, 2023 · 0 comments
Open

[BUG] route entry is not added when vrf table is used #300

yagosys opened this issue Feb 10, 2023 · 0 comments

Comments

@yagosys
Copy link

yagosys commented Feb 10, 2023

Describe the bug
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: br-10-1-128
spec:
config: |-
{
"cniVersion": "0.4.0",
"plugins": [
{
"name": "crio",
"type": "bridge",
"bridge": "cni1",
"ipMasq": false,
"ipam": {
"type": "whereabouts",
"range": "10.1.128.0/24",
"gateway": "10.1.128.2",
"log_file": "/tmp/whereabouts.log",
"log_level": "debug",
"routes": [
{
"dst": "10.2.128.0/24",
"gw": "10.1.128.2"
},
{ "dst": "1.1.1.1/32",
"gw": "10.1.128.2"
}
],
"exclude": [
"10.1.128.1/32",
"10.1.128.2/32",
"10.1.128.254/32"
]
}
},
{
"type": "vrf",
"vrfname": "test1"
}
]
}

Expected behavior
route entry specified in ipam josn need be inserted into vrf routing table.
{ "dst": "1.1.1.1/32",
"gw": "10.1.128.2"
}

ubuntu@ip-10-0-1-100:~/202301/eastwest$ kubectl exec -it po/multitool-10-1-128 -- ip r
default via 10.85.0.1 dev eth0
10.85.0.0/16 dev eth0 proto kernel scope link src 10.85.0.4

ubuntu@ip-10-0-1-100:~/202301/eastwest$ kubectl exec -it po/multitool-10-1-128 -- ip r show vrf test1
1.1.1.1 via 10.1.128.2 dev net1 <<<<<<this is missing
10.1.128.0/24 dev net1 proto kernel scope link src 10.1.128.3
To Reproduce
apply below yaml, the route entry did not install into either main route table or vrf routing table.

apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: br-10-1-128
spec:
config: |-
{
"cniVersion": "0.4.0",
"plugins": [
{
"name": "crio",
"type": "bridge",
"bridge": "cni1",
"ipMasq": false,
"ipam": {
"type": "whereabouts",
"range": "10.1.128.0/24",
"gateway": "10.1.128.2",
"log_file": "/tmp/whereabouts.log",
"log_level": "debug",
"routes": [
{
"dst": "10.2.128.0/24",
"gw": "10.1.128.2"
},
{ "dst": "1.1.1.1/32",
"gw": "10.1.128.2"
}
],
"exclude": [
"10.1.128.1/32",
"10.1.128.2/32",
"10.1.128.254/32"
]
}
},
{
"type": "vrf",
"vrfname": "test1"
}
]
}

apiVersion: v1
kind: Pod
metadata:
name: multitool-10-1-128
annotations:
k8s.v1.cni.cncf.io/networks: '[ { "name": "br-10-1-128" } ]'
spec:
containers:

  • name: multitool
    image: praqma/network-multitool
    imagePullPolicy: Always
    command: ["/bin/sh","-c"]
    args:
    • /usr/sbin/nginx -g "daemon off;"

Environment:

  • Whereabouts version :

  • Kubernetes version (use kubectl version):

  • ubuntu@ip-10-0-1-100:~/202301/eastwest$ kubectl version
    WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version.
    Client Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.1", GitCommit:"8f94681cd294aa8cfd3407b8191f6c70214973a4", GitTreeState:"clean", BuildDate:"2023-01-18T15:58:16Z", GoVersion:"go1.19.5", Compiler:"gc", Platform:"linux/amd64"}
    Kustomize Version: v4.5.7
    Server Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.1", GitCommit:"8f94681cd294aa8cfd3407b8191f6c70214973a4", GitTreeState:"clean", BuildDate:"2023-01-18T15:51:25Z", GoVersion:"go1.19.5", Compiler:"gc", Platform:"linux/amd64"}

  • Network-attachment-definition:

  • kind: NetworkAttachmentDefinition
    metadata:
    name: br-10-1-128
    spec:
    config: |-
    {
    "cniVersion": "0.4.0",
    "plugins": [
    {
    "name": "crio",
    "type": "bridge",
    "bridge": "cni1",
    "ipMasq": false,
    "ipam": {
    "type": "whereabouts",
    "range": "10.1.128.0/24",
    "gateway": "10.1.128.2",
    "log_file": "/tmp/whereabouts.log",
    "log_level": "debug",
    "routes": [
    {
    "dst": "10.2.128.0/24",
    "gw": "10.1.128.2"
    },
    { "dst": "1.1.1.1/32",
    "gw": "10.1.128.2"
    }
    ],
    "exclude": [
    "10.1.128.1/32",
    "10.1.128.2/32",
    "10.1.128.254/32"
    ]
    }
    },
    {
    "type": "vrf",
    "vrfname": "test1"
    }
    ]
    }

  • Whereabouts configuration (on the host): N/A

  • ubuntu@ip-10-0-1-100:/etc/cni/net.d/whereabouts.d$ sudo cat whereabouts.conf
    {
    "datastore": "kubernetes",
    "kubernetes": {
    "kubeconfig": "/etc/cni/net.d/whereabouts.d/whereabouts.kubeconfig"
    },
    "reconciler_cron_expression": "30 4 * * *"
    }

  • OS (e.g. from /etc/os-release): N/A

  • PRETTY_NAME="Ubuntu 22.04.1 LTS"
    NAME="Ubuntu"
    VERSION_ID="22.04"
    VERSION="22.04.1 LTS (Jammy Jellyfish)"
    VERSION_CODENAME=jammy
    ID=ubuntu
    ID_LIKE=debian
    HOME_URL="https://www.ubuntu.com/"
    SUPPORT_URL="https://help.ubuntu.com/"
    BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
    PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
    UBUNTU_CODENAME=jammy

  • Kernel (e.g. uname -a): N/A

  • Others: N/A

Additional info / context
Add any other information / context about the problem here.

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

No branches or pull requests

1 participant