Add "tolerations" parameter in Kubernetes context 31/58931/4
authorRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Fri, 22 Jun 2018 13:53:22 +0000 (14:53 +0100)
committerRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Tue, 10 Jul 2018 09:32:38 +0000 (09:32 +0000)
commit42b33dc3cba15a22214295770756c94f9be08f11
tree67cd8ad080849ec45ed7e321b1b9bb875aada974
parentff3cd7a245840606b09322c7705f8a64cf1868f2
Add "tolerations" parameter in Kubernetes context

This new parameter, "torelations", is applied to pods and allow (but not
require) the pods to schedule onto node with matching tains [1].

Example of "tolerations" definition in a Kubernetes pod:

  spec:
    containers: [...]
    tolerations:
      - key: <key defined in the taint>
        value: <key value to match with the taint>
        effect: <effect in case of match>
        operator: <matching operator>
      - key: ...

Example of "tolerations" definition in a Yardstick test case:

  context:
    type: Kubernetes
    servers:
      host:
        containers: [...]
        tolerations:
          - key: ...
            value: ...
            effect: ...
            operator: ...

NOTE: if any toleration is defined, a default one will be applied in
order to allow any replication controller to create the pods in any
Kubernetes node. This default toleration is defined as:

  spec:
    tolerations:
      - operator: "Exists"

[1] https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/

JIRA: YARDSTICK-1254

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