## ## Copyright (c) 2019 Intel Corporation ## ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file except in compliance with the License. ## You may obtain a copy of the License at ## ## http://www.apache.org/licenses/LICENSE-2.0 ## ## Unless required by applicable law or agreed to in writing, software ## distributed under the License is distributed on an "AS IS" BASIS, ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ## See the License for the specific language governing permissions and ## limitations under the License. ## ############################################################################### # REQUIREMENTS # ############################################################################### 1. Working Kubernetes cluster. It can be set up using Intel Container Bare Metal Reference Architecture https://github.com/intel/container-experience-kits 2. 1024x 2M hugepages must be configured on the nodes 3. SRIOV Network Device Plugin for Kubernetes installed https://github.com/intel/sriov-network-device-plugin. 4. SRIOV VFs configured and rebind to the vfio-pci module As an example, SRIOV VFs (rebind to the vfio-pci driver) pool is named as intel.com/intel_sriov_vfio. Network attachment definition is named as k8s.v1.cni.cncf.io/networks: intel-sriov-vfio. 5. PROX image created and pushed to the local registry or distributed and loaded on all of the testing nodes. ############################################################################### # PROX IMAGE BUILD # ############################################################################### Run # dockerimage.sh build to build PROX image. After the successfull build prox.tar will be created and can be used to load image on the k8s nodes or it can be pushed to the local repository using # dockerimage.sh push ############################################################################### # TESTING # ############################################################################### 1. Edit rapidpods file and set the right name (nodeSelector_hostname) for the nodes on which you want to execute test PODs. # kubectl get nodes -o wide NAME STATUS ROLES AGE VERSION INTERNAL-IP EXTERNAL-IP OS-IMAGE KERNEL-VERSION CONTAINER-RUNTIME k8s-master1 Ready master 7d13h v1.13.5 10.10.0.10 CentOS Linux 7 (Core) 3.10.0-1062.4.1.el7.x86_64 docker://18.6.2 k8s-node1 Ready node 7d13h v1.13.5 10.10.0.12 CentOS Linux 7 (Core) 3.10.0-1062.4.1.el7.x86_64 docker://18.6.2 k8s-node2 Ready node 7d13h v1.13.5 10.10.0.13 CentOS Linux 7 (Core) 3.10.0-1062.4.1.el7.x86_64 docker://18.6.2 Set the right IP addresses (dp_ip) to use by the PODs for the Dataplane network. 2. Edit pod-rapid.yaml file and set correct - image name (image: localhost:5000/prox:latest) - network attachment definition in metadata->annotation section (k8s.v1.cni.cncf.io/networks: intel-sriov-vfio) - SRIOV VFs resources attached to the vfio-pci driver (intel.com/intel_sriov_vfio: '1') 3. Copy SSH private key in the rapid_rsa_key file 4. Run createrapidk8s.py to create test PODs according to the configuration from rapid.pods file. # ./createrapidk8s.py Check for rapid PODs. They should be up and running. # kubectl get pods -o wide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES pod-rapid-1 1/1 Running 0 18h 10.244.2.87 k8s-node1 pod-rapid-2 1/1 Running 0 18h 10.244.1.40 k8s-node2 pod-rapid-3 1/1 Running 0 18h 10.244.1.39 k8s-node2 5. Run test case. # ./runrapid.py --test basicrapid.test ############################################################################### # NOTES # ############################################################################### If layer 2 tests are planned to be executed MAC adresses must be preconfigured for the SRIOV VFs to avoid issues with randomly generated MACs each time when the PROX starts.