Kuryr
最后更新于
最后更新于
Kuryr is a sub-project of OpenStack Neutron aimed at providing networking integration between OpenStack and Kubernetes. By implementing native Neutron-based networking within Kubernetes, Kuryr-Kubernetes facilitates co-location of OpenStack VMs and Kubernetes Pods on the same subnet. It also allows for the utilization of Neutron L3 and Security Groups for routing and security purposes, such as blocking specific source ports, and integrates services through Neutron LBaaS.
Kuryr-Kubernetes consists of two main components:
Kuryr Controller: The Controller primarily monitors changes in Kubernetes resources through the Kubernetes API and manages sub-resources and resources allocation accordingly.
Kuryr CNI: This binds the networks to Pods based on the resources allocated by the Kuryr Controller.
The simplest way to deploy a single-node environment is by using devstack:
Upon successful deployment, verify the installation:
In this section, we explain how to use DevStack
and Kubespray
to establish a simple test environment.
Prepare two physical machines, with the operating system for this test being CentOS 7.x
, which will operate on a flat network.
IP Address 1 | Role |
---|---|
172.24.0.34 | controller, k8s-master |
172.24.0.80 | compute1, k8s-node1 |
172.24.0.81 | compute2, k8s-node2 |
Update the CentOS 7.x packages on each node:
Then, disable firewalld and SELinux to prevent potential issues:
First, access 172.24.0.34 (controller)
and run the following commands.
Then, create the DevStack-specific user:
Switch to that user to create OpenStack:
Download DevStack:
Add a local.conf
file to describe the deployment details:
Modify HOST_IP to your own IP.
Finally, start the deployment with the following command:
Access 172.24.0.80 (compute)
and 172.24.0.81 (node2)
and execute the commands provided.
Then, create the DevStack-specific user:
Switch to that user to create OpenStack:
Download DevStack:
Add a local.conf
file to describe the deployment details:
Modify HOST_IP to your machine's location. Modify SERVICE_HOST to the Master's IP.
Finally, start the deployment with the following command:
Ensure all nodes can SSH into each other without a password, then enter 172.24.0.34 (k8s-master)
and run the following commands.
Install required packages:
Create a kubespray configuration file:
Use kubespray-cli to generate the environment's inventory
file and modify certain content:
Edit /root/.kubespray/inventory/inventory.cfg
to modify:
Then, deploy with kubespray-cli:
After some time, the deployment will complete. Check that nodes are up:
To facilitate Kuryr Controller's access to the K8s API Server, modify /etc/kubernetes/manifests/kube-apiserver.yml
by adding:
Bind insecurely to 0.0.0.0 and open port 8080.
Go to 172.24.0.34 (controller)
and execute the commands listed.
First, install required packages on the node:
Download and install kuryr-kubernetes:
Create kuryr.conf
in the /etc/kuryr
directory:
Use the OpenStack Dashboard to create projects by entering http://172.24.0.34
in the browser and following the steps below.
Create k8s project.
Create kuryr-kubernetes service and add k8s project member to service project.
Within that project, add Security Groups—see kuryr-kubernetes manually.
Within that project, add a pod_subnet subnet.
Within that project, add a service_subnet subnet.
After that, modify /etc/kuryr/kuryr.conf
by adding:
Run the kuryr-k8s-controller:
Access 172.24.0.80 (node1)
and 172.24.0.81 (node2)
and run the commands provided.
Install required packages on the node:
Install Kuryr-CNI for kubelet use:
Create kuryr.conf
in /etc/kuryr
directory:
Modify /etc/kuryr/kuryr.conf
by adding:
Create CNI bin and Conf directories:
Add a /etc/cni/net.d/10-kuryr.conf
CNI configuration file:
Finally, reload the daemon and restart the kubelet service:
Create a Pod and an OpenStack VM to communicate with each other:
Imagine orchestrating your containers with Kubernetes while also managing your virtual machines under the OpenStack framework—welcome to the innovative world of Kuryr. Kuryr is a cutting-edge convergence tool aimed at interlinking the advanced networking capacities of OpenStack Neutron with the robust orchestration that Kubernetes offers. This allows for a seamless interaction between Virtual Machines (VMs) managed by OpenStack and containerized Pods orchestrated by Kubernetes, all under the same virtual network umbrella.
One of the most notable advantages of this integration is that it allows VMs and Pods to share subnets, making cross-management and networking immensely simplified. Access control, security policies, and routing, typically managed by Neutron's L3 protocols and Security Groups, extend their coverage to include Pods alongside VMs.
Kuryr nests within the Kubernetes environment by adopting two pivotal roles:
Kuryr Controller: This is an observant guardian that continually scrutinizes the Kubernetes API for any changes pertaining to resource needs. As soon as it detects a shift, it leaps into action, adjusting resource allocation as needed.
Kuryr CNI: This component acts on the commands of the Kuryr Controller, adeptly connecting assigned networks to the Pods that require them.
For enthusiasts eager to dive into a single-node setup, devstack is the gateway to get your hands-on experience with Kuryr:
Verification post-installation is a breeze:
For a more elaborate setup using DevStack
and Kubespray
, it's as straightforward as setting up a classic high-school science experiment. Begin by preparing two trusty server-side companions with CentOS 7.x
as the brain of operations. After a simple update dance for your CentOS packages, turn off the watchdogs—firewalld and SELinux—to ensure smooth sailing ahead.
Deployment involves cloning devstack again, with each node snuggling up to its individual configuration file and the deployment chugging along smoothly.
Now the magic happens—bringing Kubernetes into the mix. Using Kubespray
, you’ll fashion a Kubernetes cluster environment as easily as baking a pie. With SSH keys in hand, seamlessly jump between your nodes, smoothening any creases with Ansible and laying down the orchestration tunes.
As the final act, Kuryr takes the stage. The Kuryr Controller tiptoes into each node, escorted by its loyal kuryr.conf
configuration file that details the harmony needed between Kubernetes and OpenStack networking.
Secure, connect, and bask in the glory of a successful multi-node adventure.
Illustrations of Pods whimpering in harmony with OpenStack VMs decorate your dashboard, a testament to your engineering prowess. The fruits of your labor yield seamless connectivity under the protective gaze of Kuryr.
A knight never goes into battle without his sword, and likewise, a Kuryr architect should never dive into deployment without the sacred scrolls of knowledge. Fear not! The Kuryr kubernetes documentation is your grimoire, your book of spells to conquer the realms of cloud and container networking.
Don your mantle, join the Kuryr crusade, and weave the networks of tomorrow.