Clover initial commit for servicemesh/route_rules, 09/53609/5
authorStephen Wong <stephen.kf.wong@gmail.com>
Mon, 12 Mar 2018 23:41:57 +0000 (16:41 -0700)
committerStephen Wong <stephen.kf.wong@gmail.com>
Sat, 31 Mar 2018 02:31:15 +0000 (19:31 -0700)
commitcb2b1a1cc38e7b0b174a33553695805015ae382c
treebb8ca618d8f7fbddba215bbb40b0e87224277632
parentc43c773fc33167f46461b4fd1ae58e40d390d59e
Clover initial commit for servicemesh/route_rules,
orchestration/kube_client, and tools/clover_validate_rr

Add an 'orchestration' directory. Please note that
'orchestration' does NOT mean Clover does any orchestration ---
similar to how Clover doesn't by itself implement tracing or
logging, orchestration is a directory for code related to Docker
orchestration client --- such as k8s client

kube_client utilizes the Kubernetes python client (a dependency)
to perform tasks against Kubernetes API server. For this commit,
it is only tested for weighted route rule verification, it does
three tasks:
(1) get a list of pods under a namespace --- pod dictionary now
    only contains pod name and label dictionary: used to match
    pod name with the node name in traces from OpenTracing
(2) check to see if a particular pod is up in a particular
    namespace: used to check if Istio pods are running in
    istio-system namespace
(3) check if a container exists in a list of pods under a
    namespace: used to check if application pods have
    istio-proxy container running

route_rule directly invokes istioctl as there isn't any Istio
Python client yet.  Currently it reads and parses routerules
from Istio, and validates if a particular trace result matches
the routerules

Finally, a sample tool clover_validate_rr is provided. This
tool assumes a previous test has been ran (with an id with
both the route-rule-under-test and corresponding traces are
stored --- currently the assumption is tests were ran with
redis-master running on system). The tool can be invoked:

python clover_validate_rr.py -t <test-id> -s <service name>

where test-id is the ID of the test (most likely uuid) and
service name is the name of the service running in the
Kubernetes cluster upon which test traces should be fetched
against

Change-Id: Ic8ab6efc23c71ac4643bee796ef986a86f6fc7dd
Signed-off-by: Stephen Wong <stephen.kf.wong@gmail.com>
clover/orchestration/Pipfile [new file with mode: 0644]
clover/orchestration/Pipfile.lock [new file with mode: 0644]
clover/orchestration/__init__.py [new file with mode: 0644]
clover/orchestration/kube_client.py [new file with mode: 0644]
clover/servicemesh/route_rules.py [new file with mode: 0644]
clover/tools/__init__.py [new file with mode: 0644]
clover/tools/clover_validate_rr.py [new file with mode: 0644]
clover/tools/validate_rr.py [new file with mode: 0644]