Playing with provisioning of Kubernetes cluster on vSphere using Kubespray and Terraform to automate deployment process (no problems with that).
My goal is to have ability to connect Pods to different VLANs (or Port Groups), so then each app will run in it's own network like my VMs do.
I think there is 2 approaches:
1. Create 'All VLANs Port Group (0-4095)' and manage VLANs inside K8S node OS
2. Attach multiply NICs to K8S node VMs each of them will be connected to different VLAN
After googling for weeks I'm still can't find solution for similar requirements.
So my problem is that I'm stuck trying to figure out how to build K8S cluster this way and in the same time I'm not completely sure that I'm on the right way at all.
Please help me before I'm go mad!
Best Answer
This can be achieved with multus-cni plugin. It creates
NetworkAttachmentDefinition
custom resource, where you can specify network interface, i.e.And then, you attach this configuration to the pod:
Furthermore, you can add more interfaces to a pod by creating more custom resources and then referring to them in pod’s annotation
More details.