nephio-experimental/one-summit-22-workshop

UPF Orchestration: Missing IPam.Gw Configuration in GH Repo Package

Opened this issue · 3 comments

If you have the UPF in the Running state, so to repeat the demo, this is what I do - I delete the “agg-upf-package” from the GH repo, and then the deployment package from “Deployment” repo in PORCH. After this once we Propose and Approve, the “networkattachmentdefinition_upf-deployment-n3.yaml” in the repo has a missing ipam.gateway parameter..and this causes the NAD information to be missing in the cluster hence the UPF is in the creating state. I think this issue should be flagged in the draft stage itself, but somehow it just allows us to propose/approve..the work around is to manually edit it in the repo, and cofigsync will reconcile it with the cluster, then UPF should be in the Running state.

logs from the UPF pods:
Events:
Type Reason Age From Message


Normal Scheduled 70s default-scheduler Successfully assigned upf/upf-deployment-57f885657f-cpq9g to edge1-control-plane
Warning FailedCreatePodSandBox 70s kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "7320c3ba6438ef7f835aabf751791dd63b041f54cbda125e367980490b09c93f": plugin type="multus" name="multus-cni-network" failed (add): Multus: [upf/upf-deployment-57f885657f-cpq9g/b0423c6a-3107-4a4d-99e7-76573f1d1d9b]: error loading k8s delegates k8s args: TryLoadPodDelegates: error in getting k8s network for pod: GetNetworkDelegates: failed getting the delegate: GetCNIConfig: err in getCNIConfigFromSpec: failed to unmarshal Spec.Config: invalid character '"' after object key:value pair
Warning FailedCreatePodSandBox 54s kubelet Failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "1390c26cdf2e865d1647300260d1a195b93d4dc1b5092d2c0fb3453089d7af77": plugin type="multus" name="multus-cni-network" failed (add): Multus: [upf/upf-deployment-57f885657f-cpq9g/b0423c6a-3107-4a4d-99e7-76573f1d1d9b]: error loading k8s delegates k8s args: TryLoadPodDelegates: error in getting k8s network for pod: GetNetworkDelegates: failed getting the delegate: GetCNIConfig: err in getCNIConfigFromSpec: failed to unmarshal Spec.Config: invalid character '"' after object key:value pair

N3 NAD yaml:

apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: upf-deployment-n3
namespace: upf
spec:
config: '{ "cniVersion": "0.3.1", "plugins": [ { "type": "macvlan", "capabilities": { "ips": true }, "master": "eth0", "mode": "bridge", "ipam": { "type": "static", "addresses": [ { "address": "10.0.0.2/32", "gateway": """" } ] } }, { "capabilities": { "mac": true }, "type": "tuning" } ] }'

could I get the logs from the ipam on this one to see what it does. it is weird that no GW is returned. When I look at the code, the GW is not returned if the prefix is not allocated with a gateway attribute.

Will do..

e-vpc" > selector:<key:"nephio.org/network-name" value:"sample-n3-net" > "}
1.6747025309381537e+09 INFO allocate {"alloc": "namespace:"upf" name:"upf-edge1-n3" kind:"ipam" labels:<key:"nephio.org/interface" value:"n3" > spec:<prefixkind:"network" selector:<key:"nephio.org/network-instance" value:"sample-vpc" > selector:<key:"nephio.org/network-name" value:"sample-n3-net" > > "}
1.6747025309382448e+09 INFO allocate prefix {"alloc": {"namespacedName":{"Namespace":"upf","Name":"upf-edge1-n3"},"origin":"allocation","networkInstance":"sample-vpc","prefixKind":"network","network":"sample-n3-net","labels":{"nephio.org/interface":"n3"},"selectorLabels":{"nephio.org/network-instance":"sample-vpc","nephio.org/network-name":"sample-n3-net"}}}
1.6747025309382985e+09 INFO validate w/o prefix {"cr": "upf-edge1-n3", "prefix": ""}
1.6747025309383879e+09 INFO applyAllocation {"alloc": {"namespacedName":{"Namespace":"upf","Name":"upf-edge1-n3"},"origin":"allocation","networkInstance":"sample-vpc","prefixKind":"network","network":"sample-n3-net","labels":{"nephio.org/address-family":"","nephio.org/allocation-name":"upf-edge1-n3","nephio.org/interface":"n3","nephio.org/origin":"prefix","nephio.org/prefix-kind":"network","nephio.org/prefix-name":"upf-edge1-n3"},"selectorLabels":{"nephio.org/network-instance":"sample-vpc","nephio.org/network-name":"sample-n3-net"}}}
1.6747025309384134e+09 INFO allocate prefix {"kind": "network", "alloc": {"namespacedName":{"Namespace":"upf","Name":"upf-edge1-n3"},"origin":"allocation","networkInstance":"sample-vpc","prefixKind":"network","network":"sample-n3-net","labels":{"nephio.org/address-family":"","nephio.org/allocation-name":"upf-edge1-n3","nephio.org/interface":"n3","nephio.org/origin":"prefix","nephio.org/prefix-kind":"network","nephio.org/prefix-name":"upf-edge1-n3"},"selectorLabels":{"nephio.org/network-instance":"sample-vpc","nephio.org/network-name":"sample-n3-net"}}}
1.6747025309385788e+09 INFO gateway {"gatewaySelector": "nephio.org/gateway in (true),nephio.org/network-instance in (sample-vpc),nephio.org/network-name in (sample-n3-net)"}
1.6747025309386873e+09 INFO allocatedPrefix {"allocatedPrefix": {"AllocatedPrefix":"10.0.0.2/32","Gateway":""}}