Add "ports" parameters in Kubernetes context 37/57537/15
authorJohn O'Loughlin <john.oloughlin@intel.com>
Thu, 17 May 2018 15:06:53 +0000 (15:06 +0000)
committerRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Tue, 10 Jul 2018 09:31:30 +0000 (10:31 +0100)
commitff3cd7a245840606b09322c7705f8a64cf1868f2
tree59a2cb213e0991cb2ea4184ef961882e1dc1e660
parent028e92b1b2dcbaffd4a80061cc3d387877b59d62
Add "ports" parameters in Kubernetes context

This new parameter, "ports", will allow the user to
automatically to add port variables in a pod definition:
context:
  type: Kubernetes
    servers:
        host:
            image: ...
            commands: ...
            ports:
                - containerPort: <port value>    # Mandatory
                  hostIP: <host IP>              # Optional
                  hostPort: <host port>          # Optional
                  name: <port name>              # Optional
                  protocol: <protocol name>      # Optional

The port type and the definition must be one of the supported ones
in Kubernetes [1].

Container port definition, V1 API, Kubernetes Python library v6.0.0 [2]

[1] https://kubernetes.io/docs/concepts/services-networking/connect-applications-service/
[2] https://github.com/kubernetes-client/python/blob/6.0.0/kubernetes/client/models/v1_container_port.py

JIRA: YARDSTICK-1183

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