[4.0.1 Build 27] K8S Nested: Kube Manager code always expecting VM interface name as eth0

Bug #1710430 reported by chhandak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R4.0
Fix Committed
Critical
Dinesh Bakiaraj
Trunk
Fix Committed
Critical
Dinesh Bakiaraj

Bug Description

In K8S nested mode with Ubuntu 16.04 (Host and Container Both), POD is not getting IP. While creating POD, neutron port is getting created properly with sub interface. Even agent introspect is having required sub interface entry. But not seeing this port getting created on host VM. On furthyer analysis , kube-manager code is setting up /etc/cni/net.d/10-contrail-cni-nested.conf with wrong intreface name. It is epcecting VM which has launched K8S is always having intreface named eth0.

{
   "cniVersion": "0.2.0",
   "contrail" : {
       "mode" : "k8s",
       "vif-type" : "macvlan",
       "parent-interface" : "eth0", ------> changing this to right intreface name solved the problem
       "vrouter-ip" : "10.10.10.101",
       "vrouter-port" : 9091,
       "config-dir" : "/var/lib/contrail/ports/vm",
       "poll-timeout" : 5,
       "poll-retries" : 15,
       "log-dir" : "/var/log/contrail/cni",
       "log-file" : "/var/log/contrail/cni/opencontrail.log",
       "log-level" : "4"
   },
   "name": "contrail-k8s-cni",
   "type": "contrail-k8s-cni"
}

Entry in Agent introspect
7
default__ubuntuapp-3
6d8dd43e-7fbb-11e7-be66-02a4b482907a
default-domain:admin:k8s-nested-cluster:k8s-nested-cluster

root@vm-test-1:~# kubectl get pods -o wide
NAME READY STATUS RESTARTS AGE IP NODE
ubuntuapp 1/1 Running 0 56m <none> vm-test-2
ubuntuapp-3 0/1 ContainerCannotRun 0 19m <none> vm-test-3

As per API server ubuntuapp is getting IP 10.47.255.252

root@5b8s38:~# rt --dump 1 | more | grep 10.47.255.252
10.47.255.252/32 32 PT - 33 -
root@5b8s38:~# nh --get 33
Id:33 Type:Encap Fmly: AF_INET Rid:0 Ref_cnt:4 Vrf:1
              Flags:Valid, Policy, Etree Root,
              EncapFmly:0806 Oif:6 Len:18
              Encap Data: 02 8c 0c 07 08 7f 00 00 5e 00 01 00 81 00 00 01 08 00

root@5b8s38:~# vif --get 6
Vrouter Interface Table

Flags: P=Policy, X=Cross Connect, S=Service Chain, Mr=Receive Mirror
       Mt=Transmit Mirror, Tc=Transmit Checksum Offload, L3=Layer 3, L2=Layer 2
       D=DHCP, Vp=Vhost Physical, Pr=Promiscuous, Vnt=Native Vlan Tagged
       Mnp=No MAC Proxy, Dpdk=DPDK PMD Interface, Rfl=Receive Filtering Offload, Mon=Interface is Monitored
       Uuf=Unknown Unicast Flood, Vof=VLAN insert/strip offload, Df=Drop New Flows, L=MAC Learning Enabled
       Proxy=MAC Requests Proxied Always, Er=Etree Root

vif0/6 default__ubuntuapp Vlan(o/i)(,S): 1/1 Bridge Index: 0 Parent:vif0/3
            Type:Virtual(Vlan) HWaddr:00:00:5e:00:01:00 IPaddr:0
            Vrf:1 Flags:PL3DEr QOS:-1 Ref:5
            RX packets:0 bytes:0 errors:0
            TX packets:418 bytes:19228 errors:0
            Drops:0

root@5b8s38:~# ifconfig | grep vlan
root@5b8s38:~# ifconfig | grep vlandefault__ubuntuapp
root@5b8s38:~# ifconfig | grep default__ubuntuapp

CNI Error Log
---------------
I : 10553 : 2017/08/13 00:00:59 macvlan.go:266: {CniIntf:{containerId:29aa2952e035e817ad72c534355c580b6a2d8e7a534d0540c3db53c7f77a7aed containerUuid:29e4f426-7fb9-11e7-99dd-02a4b482907a containerIfName:eth0 containerNamespace: mtu:1500} ParentIfName:eth0 vlanIfName:vlan29e4f426-7f vlanId:0 containerTmpIfName:mac29e4f426-7f}
I : 10553 : 2017/08/13 00:00:59 vrouter.go:394: File /var/lib/contrail/ports/vm/29e4f426-7fb9-11e7-99dd-02a4b482907a not found. Error : stat /var/lib/contrail/ports/vm/29e4f426-7fb9-11e7-99dd-02a4b482907a: no such file or directory
E : 10553 : 2017/08/13 00:00:59 cni.go:205: Failed in CanDelete
I : 10558 : 2017/08/13 00:00:59 contrail-kube-cni.go:82: Came in Del for container 6f4eaeb95b3e83437c67a2a5cc94131ba9b8eb7398712c4df05ed99985218948
I : 10558 : 2017/08/13 00:00:59 contrail-kube-cni.go:40: getPodInfo success. container-id 6f4eaeb95b3e83437c67a2a5cc94131ba9b8eb7398712c4df05ed99985218948 uuid 29e4f426-7fb9-11e7-99dd-02a4b482907a name ubuntuapp-2
I : 10558 : 2017/08/13 00:00:59 cni.go:85: ContainerID : 6f4eaeb95b3e83437c67a2a5cc94131ba9b8eb7398712c4df05ed99985218948
I : 10558 : 2017/08/13 00:00:59 cni.go:86: NetNS :
I : 10558 : 2017/08/13 00:00:59 cni.go:87: Container Ifname : eth0
I : 10558 : 2017/08/13 00:00:59 cni.go:88: Args : IgnoreUnknown=1;K8S_POD_NAMESPACE=default;K8S_POD_NAME=ubuntuapp-2;K8S_POD_INFRA_CONTAINER_ID=6f4eaeb95b3e83437c67a2a5cc94131ba9b8eb7398712c4df05ed99985218948
I : 10558 : 2017/08/13 00:00:59 cni.go:89: Config File : {"cniVersion":"0.2.0","contrail":{"config-dir":"/var/lib/contrail/ports/vm","log-dir":"/var/log/contrail/cni","log-file":"/var/log/contrail/cni/opencontrail.log","log-level":"4","mode":"k8s","parent-interface":"eth0","poll-retries":15,"poll-timeout":5,"vif-type":"macvlan","vrouter-ip":"10.10.10.101","vrouter-port":9091},"name":"contrail-k8s-cni","type":"contrail-k8s-cni"}
I : 10558 : 2017/08/13 00:00:59 cni.go:90: &{cniArgs:0xc4202ad340 Mode:k8s VifType:macvlan VifParent:eth0 LogDir:/var/log/contrail/cni LogFile:/var/log/contrail/cni/opencontrail.log LogLevel:4 ContainerUuid:29e4f426-7fb9-11e7-99dd-02a4b482907a ContainerName:ubuntuapp-2 ContainerVn: VRouter:{Server:10.10.10.101 Port:9091 Dir:/var/lib/contrail/ports/vm PollTimeout:5 PollRetries:15 containerId: containerUuid: containerVn: httpClient:0xc4201a5710}}
I : 10558 : 2017/08/13 00:00:59 vrouter.go:442: {Server:10.10.10.101 Port:9091 Dir:/var/lib/contrail/ports/vm PollTimeout:5 PollRetries:15 containerId: containerUuid: containerVn: httpClient:0xc4201a5710}
I : 10558 : 2017/08/13 00:00:59 macvlan.go:289: Initialized MacVlan interface {CniIntf:{containerId:6f4eaeb95b3e83437c67a2a5cc94131ba9b8eb7398712c4df05ed99985218948 containerUuid:29e4f426-7fb9-11e7-99dd-02a4b482907a containerIfName:eth0 containerNamespace: mtu:1500} ParentIfName:eth0 vlanIfName:vlan29e4f426-7f vlanId:0 containerTmpIfName:mac29e4f426-7f}
I : 10558 : 2017/08/13 00:00:59 macvlan.go:266: {CniIntf:{containerId:6f4eaeb95b3e83437c67a2a5cc94131ba9b8eb7398712c4df05ed99985218948 containerUuid:29e4f426-7fb9-11e7-99dd-02a4b482907a containerIfName:eth0 containerNamespace: mtu:1500} ParentIfName:eth0 vlanIfName:vlan29e4f426-7f vlanId:0 containerTmpIfName:mac29e4f426-7f}
I : 10558 : 2017/08/13 00:00:59 vrouter.go:394: File /var/lib/contrail/ports/vm/29e4f426-7fb9-11e7-99dd-02a4b482907a not found. Error : stat /var/lib/contrail/ports/vm/29e4f426-7fb9-11e7-99dd-02a4b482907a: no such file or directory
E : 10558 : 2017/08/13 00:00:59 cni.go:205: Failed in CanDelete

Contrail-Kube-manager-log
--------------------------
08/13/2017 12:22:03 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got ADDED Pod kube-system:kube-dns-2425271678-93c8g:d43885d7-7fb5-11e7-997f-02a4b482907a
08/13/2017 12:22:03 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: PodMonitor - Got ADDED Pod default:ubuntuapp-3:6d6b5022-7fbb-11e7-99dd-02a4b482907a
08/13/2017 12:22:03 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got ADDED Pod default:ubuntuapp-3:6d6b5022-7fbb-11e7-99dd-02a4b482907a
08/13/2017 12:22:03 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: PodMonitor - Got ADDED Pod default:ubuntuapp:52d8b753-7fb6-11e7-acfc-02a4b482907a
08/13/2017 12:22:03 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got ADDED Pod default:ubuntuapp:52d8b753-7fb6-11e7-acfc-02a4b482907a
08/13/2017 12:22:05 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got DELETED Pod None:None:006b74ad-7fb8-11e7-99dd-02a4b482907a
08/13/2017 12:22:05 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got DELETED Pod None:None:29e4f426-7fb9-11e7-99dd-02a4b482907a
08/13/2017 12:23:05 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got DELETED Pod None:None:006b74ad-7fb8-11e7-99dd-02a4b482907a
08/13/2017 12:23:05 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got DELETED Pod None:None:29e4f426-7fb9-11e7-99dd-02a4b482907a
08/13/2017 12:24:05 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got DELETED Pod None:None:006b74ad-7fb8-11e7-99dd-02a4b482907a
08/13/2017 12:24:05 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got DELETED Pod None:None:29e4f426-7fb9-11e7-99dd-02a4b482907a
08/13/2017 12:25:05 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got DELETED Pod None:None:006b74ad-7fb8-11e7-99dd-02a4b482907a
08/13/2017 12:25:05 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got DELETED Pod None:None:29e4f426-7fb9-11e7-99dd-02a4b482907a
08/13/2017 12:26:05 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got DELETED Pod None:None:006b74ad-7fb8-11e7-99dd-02a4b482907a
08/13/2017 12:26:05 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got DELETED Pod None:None:29e4f426-7fb9-11e7-99dd-02a4b482907a
08/13/2017 12:27:05 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got DELETED Pod None:None:006b74ad-7fb8-11e7-99dd-02a4b482907a
08/13/2017 12:27:05 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got DELETED Pod None:None:29e4f426-7fb9-11e7-99dd-02a4b482907a
08/13/2017 12:28:05 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got DELETED Pod None:None:006b74ad-7fb8-11e7-99dd-02a4b482907a
08/13/2017 12:28:05 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got DELETED Pod None:None:29e4f426-7fb9-11e7-99dd-02a4b482907a
08/13/2017 12:29:05 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got DELETED Pod None:None:006b74ad-7fb8-11e7-99dd-02a4b482907a
08/13/2017 12:29:05 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got DELETED Pod None:None:29e4f426-7fb9-11e7-99dd-02a4b482907a
08/13/2017 12:30:05 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got DELETED Pod None:None:006b74ad-7fb8-11e7-99dd-02a4b482907a
08/13/2017 12:30:05 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got DELETED Pod None:None:29e4f426-7fb9-11e7-99dd-02a4b482907a
08/13/2017 12:31:05 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got DELETED Pod None:None:006b74ad-7fb8-11e7-99dd-02a4b482907a
08/13/2017 12:31:05 AM [contrail-kube-manager]: __default__ [SYS_DEBUG]: KubeManagerDebugLog: VncPod - Got DELETED Pod None:None:29e4f426-7fb9-11e7-99dd-02a4b482907

chhandak (chhandak)
Changed in juniperopenstack:
importance: Undecided → Critical
milestone: none → r4.0.1.0
information type: Proprietary → Public
summary: - [4.0.1 Build 27] K8S Nested: Pod not getting IP
+ [4.0.1 Build 27] K8S Nested: Pod is not getting IP
tags: added: contrail-kube-cni
chhandak (chhandak)
summary: - [4.0.1 Build 27] K8S Nested: Pod is not getting IP
+ [4.0.1 Build 27] K8S Nested: Kube Manager code always expecting VM
+ interface name as eth0
description: updated
Changed in juniperopenstack:
assignee: nobody → Dinesh Bakiaraj (dineshb)
tags: added: blocker
Changed in juniperopenstack:
assignee: Dinesh Bakiaraj (dineshb) → Sachchidanand Vaidya (vaidyasd)
Revision history for this message
Sachchidanand Vaidya (vaidyasd) wrote :

Workaround for this bug:
  After installing CNI plugin in nested mode, goto minion nodes and change "parent-interface" to value to reflect VM's interface name. This bug will be fixed in 4.0.1+ release.

tags: added: releasenote
Changed in juniperopenstack:
milestone: r4.0.1.0 → r4.0.2.0
Changed in juniperopenstack:
assignee: Sachchidanand Vaidya (vaidyasd) → Dinesh Bakiaraj (dineshb)
Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] R4.0

Review in progress for https://review.opencontrail.org/35498
Submitter: Dinesh Bakiaraj (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/35499
Submitter: Dinesh Bakiaraj (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/35500
Submitter: Dinesh Bakiaraj (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/35498
Submitter: Dinesh Bakiaraj (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : [Review update] master

Review in progress for https://review.opencontrail.org/35501
Submitter: Dinesh Bakiaraj (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/35502
Submitter: Dinesh Bakiaraj (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/35504
Submitter: Dinesh Bakiaraj (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/35504
Committed: http://github.com/Juniper/contrail-ansible/commit/7c114c35ec4b6aa1564e768f874a57ff31d2cf8b
Submitter: Zuul (<email address hidden>)
Branch: master

commit 7c114c35ec4b6aa1564e768f874a57ff31d2cf8b
Author: dineshb-jnpr <email address hidden>
Date: Mon Sep 11 20:21:24 2017 -0700

Make kubernetes host interface name configurable.

The host data inteface of a k8s node can be named differently
based on the OS type(eth0/ens3/p1p1 etc). This commit exposes a knob
"k8s_node_data_interface" which can be used to specify the interface
name of the k8s compute node in the ansible inventory file.

Example:

[contrail-compute]
10.84.31.68 kubernetes_node_interface=ens3

If kubernetes_node_interface is not specified for a compute node, then
'eth0' is assumed to be name of the interface for that node.

The interface name, so deduced/specified, is populated in the CNI configuration
on kubernetes compute nodes and is used by contrail cni for data path stitching.

Change-Id: Id9c2ff88fcc13a429becb9fb61f8876cd9b3a4d5
Partial-Bug: 1710430

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/35502
Committed: http://github.com/Juniper/contrail-docker/commit/4c585231fa8329484fbdfb106bd552cb18429d5f
Submitter: Zuul (<email address hidden>)
Branch: master

commit 4c585231fa8329484fbdfb106bd552cb18429d5f
Author: dineshb-jnpr <email address hidden>
Date: Mon Sep 11 19:50:08 2017 -0700

Make cni interface name configurable.

This commit exposes knob "kubernetes_node_data_interface", i.e:

[GLOBAL]
kubernetes_node_data_interface = eth0

which when populated in the contrailctl file of kubernetes agent,
will populate the CNI conf file approriately.

Change-Id: I29fe4566aabff22fc287dc8710e01f1bf7fad0f4
Partial-Bug: 1710430

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/35501
Committed: http://github.com/Juniper/contrail-ansible-internal/commit/e88dfac7ddb074422efe9eb130996094a6017084
Submitter: Zuul (<email address hidden>)
Branch: master

commit e88dfac7ddb074422efe9eb130996094a6017084
Author: dineshb-jnpr <email address hidden>
Date: Mon Sep 11 19:40:44 2017 -0700

Make cni interface name configurable.

This commit exposes knob "kubernetes_node_data_interface", i.e:

[GLOBAL]
kubernetes_node_data_interface = eth0

which when populated in the contrailctl file of kubernetes agent,
will populate the CNI conf file approriately.

Change-Id: Iab41c65184d4cfe0f9d67fdad2e11ae41f13698f
Partial-Bug: 1710430

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/35499
Committed: http://github.com/Juniper/contrail-docker/commit/3415d0fc55d49d30b2e4ea2b3b26baa4005dcd55
Submitter: Zuul (<email address hidden>)
Branch: R4.0

commit 3415d0fc55d49d30b2e4ea2b3b26baa4005dcd55
Author: dineshb-jnpr <email address hidden>
Date: Mon Sep 11 19:50:08 2017 -0700

Make cni interface name configurable.

This commit exposes knob "kubernetes_node_data_interface", i.e:

[GLOBAL]
kubernetes_node_data_interface = eth0

which when populated in the contrailctl file of kubernetes agent,
will populate the CNI conf file approriately.

Change-Id: I29fe4566aabff22fc287dc8710e01f1bf7fad0f4
Partial-Bug: 1710430

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/35500
Committed: http://github.com/Juniper/contrail-ansible/commit/9e534122b0e9ee223b9ea82ae1c383fbb116bd8a
Submitter: Zuul (<email address hidden>)
Branch: R4.0

commit 9e534122b0e9ee223b9ea82ae1c383fbb116bd8a
Author: dineshb-jnpr <email address hidden>
Date: Mon Sep 11 20:04:23 2017 -0700

Make kubernetes host interface name configurable.

The host data inteface of a k8s node can be named differently
based on the OS type(eth0/ens3/p1p1 etc). This commit exposes a knob
"k8s_node_data_interface" which can be used to specify the interface
name of the k8s compute node in the ansible inventory file.

Example:

[contrail-compute]
10.84.31.68 kubernetes_node_interface=ens3

If kubernetes_node_interface is not specified for a compute node, then
'eth0' is assumed to be name of the interface for that node.

The interface name, so deduced/specified, is populated in the CNI configuration
on kubernetes compute nodes and is used by contrail cni for data path stitching.

Change-Id: I45929780673d174130e155dd12975a52371573d1
Partial-Bug: 1710430

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Reviewed: https://review.opencontrail.org/35498
Committed: http://github.com/Juniper/contrail-ansible-internal/commit/d0209c7b70a19a66c31af2ae11e65eee919ff869
Submitter: Zuul (<email address hidden>)
Branch: R4.0

commit d0209c7b70a19a66c31af2ae11e65eee919ff869
Author: dineshb-jnpr <email address hidden>
Date: Mon Sep 11 19:40:44 2017 -0700

Make cni interface name configurable.

This commit exposes knob "kubernetes_node_data_interface", i.e:

[GLOBAL]
kubernetes_node_data_interface = eth0

which when populated in the contrailctl file of kubernetes agent,
will populate the CNI conf file approriately.

Change-Id: Iab41c65184d4cfe0f9d67fdad2e11ae41f13698f
Partial-Bug: 1710430

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.