Specify the networks to be used per pod 35/57435/4
authorRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Tue, 15 May 2018 15:03:30 +0000 (16:03 +0100)
committerRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Thu, 14 Jun 2018 07:15:47 +0000 (07:15 +0000)
commit9c19d2dc2ca9057d5d27b3e1b77e40fee2fcc6d4
tree92eebc5739778f3d963b9003185acec8ab58e100
parent1042a7077bba049d51022b7f4914048afb521cb1
Specify the networks to be used per pod

If CRD "Network" is defined and network items are created, each pod (server)
can have access to one or several networks. This is defined in the metadata
section, as "annotations.networks" [1].

Example of Kubernetes pod definition with networks:
  apiVersion: v1
  kind: Pod
  metadata:
    name: test-pod
    annotations:
      networks: '[{"name": "flannel"}]'

Example of Yardstick server definition with networks:
  context:
    type: Kubernetes
    servers:
      host:
        containers:
          - name: ...
        networks:
          - flannel  # These names must be defined in
                     # context.networks
    ...
    networks:
      - name: flannel
        plugin: flannel

Kubernetes annotations [2].

[1]https://github.com/intel/multus-cni/tree/b9446232cdf4f1b6f2bea583291973cc97e963f4#configuring-multus-to-use-kubeconfig-and-a-default-network
[2]https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/

JIRA: YARDSTICK-1178

Change-Id: I6e7b4bacf10810833ec733c14d44e5db613675e3
Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
yardstick/orchestrator/kubernetes.py
yardstick/tests/unit/orchestrator/test_kubernetes.py