Oh, I actually should have thought about it. So if you'll precreate the network, subnet and a KuryrNet Custom Resource [1] it should actually work. The definition of KuryrNet can be find here [2], fields are pretty self-explanatory. Please note that you also need to link KuryrNet to the namespace by adding an annotation to the namespace: "openstack.org/kuryr-net-crd": "ns-<namespace-name>" Also, just for safety, make sure the KuryrNet itself is named "ns- <namespace-name>" - I'm not sure if some code isn't looking it up by name. Please note that this was never tested, so maybe there's something I don't see that might prevent it from working. [1] https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-r... [2] https://github.com/openstack/kuryr-kubernetes/blob/a85a7bc8b1761eb748ccf1643... On Tue, 2019-10-22 at 14:11 +0000, Yi Yang (杨燚)-云服务集团 wrote:
Thanks Luis, what if I have created network and subnet with network name and subnet name the namespace driver will create? I just want to check if it can use an existing tenant network and subnet which can be specified by namespace or annotation.
发件人: Luis Tomas Bolivar [mailto:ltomasbo@redhat.com] 发送时间: 2019年10月22日 19:21 收件人: Yi Yang (杨燚)-云服务集团 <yangyi01@inspur.com> 抄送: openstack-discuss@lists.openstack.org 主题: Re: [kuryr][kuryr-kubernetes] does kuryr-kubernetes support dynamic subnet by pod namespace or annotation?
Hi Yi Yang,
On Tue, Oct 22, 2019 at 4:43 AM Yi Yang (杨燚)-云服务集团 < yangyi01@inspur.com> wrote:
Hi, Folks
We need to create containers on baremetal for different tenants, so pod belongs to tenant VPC or tenant subnet, can we specify subnet by namespace or annotation in pod spec? I don’t mean multiple VIFs by additional subnets, I just need single OVS port for pod.
There is a namespace handler (and namespace_subnet driver) that creates a different subnet/network per K8s namespace, but those networks are created by that handle in the same tenant account (kuryr is single tenant).
-- LUIS TOMÁS BOLÍVAR Senior Software Engineer Red Hat Madrid, Spain ltomasbo@redhat.com