Add "resources" parameter in Kubernetes context 93/57393/4
authorJohn O Loughlin <john.oloughlin@intel.com>
Tue, 15 May 2018 10:43:05 +0000 (11:43 +0100)
committerRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Fri, 6 Jul 2018 09:02:37 +0000 (09:02 +0000)
commitb5cafe95acef8a14def98192b6de96b92b574cef
tree8f6e7a415824cab93be2b239e8683715758bfe39
parentab8629071966fb46a4eeac473cda3352424fa350
Add "resources" parameter in Kubernetes context

This new parameter, "resources", will allow the user to automatically
add resources in a pod definition per container.

Example of yaml definition in Kubernetes:
apiVersion: v1
kind: Pod
metadata:
  name: frontend
spec:
  containers:
    - name: db
      image: mysql
      resources:
        requests:
          memory: "64Mi"
          cpu: "250m"
        limits:
          memory: "128Mi"
          cpu: "500m"

Example of definition in a Yardstick context:
context:
  type: Kubernetes
    servers:
        host:
            resources:    # There are two possible keys in this dict:
                          # "requests" and "limits".
              limits: <dictionary>
              requests: <dictionary>

Resources in containers [1].

[1] https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/

JIRA:YARDSTICK-1171

Change-Id: I163d72d9d3e88b538fca73eb4dbf38613aa23ff4
Signed-off-by: John O Loughlin <john.oloughlin@intel.com>
yardstick/orchestrator/kubernetes.py
yardstick/tests/unit/orchestrator/test_kubernetes.py