summaryrefslogtreecommitdiffstats
path: root/VNFs/DPPD-PROX/helper-scripts/rapid/README.k8s
blob: e1abbe758e6915e876d67dd092768f4c818f1b04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
##
## 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    <none>        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    <none>        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    <none>        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   <none>           <none>
pod-rapid-2   1/1     Running   0          18h   10.244.1.40   k8s-node2   <none>           <none>
pod-rapid-3   1/1     Running   0          18h   10.244.1.39   k8s-node2   <none>           <none>

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.