diff options
-rw-r--r-- | Pipfile | 10 | ||||
-rw-r--r-- | Pipfile.lock | 84 | ||||
-rw-r--r-- | clover/tracing/tracing.py | 2 | ||||
-rw-r--r-- | clover/tracing/validate.py | 39 | ||||
-rw-r--r-- | docker/Dockerfile | 1 | ||||
-rwxr-xr-x | docker/setup.sh | 13 | ||||
-rw-r--r-- | docs/development/design/tracing.rst | 19 | ||||
-rw-r--r-- | docs/release/release-notes/index.rst | 15 | ||||
-rw-r--r-- | docs/release/userguide/index.rst | 13 | ||||
-rw-r--r-- | requirements.txt | 4 | ||||
-rwxr-xr-x | samples/scenarios/clean.sh | 28 | ||||
-rwxr-xr-x | samples/scenarios/deploy.sh | 22 | ||||
-rwxr-xr-x | samples/scenarios/view.sh | 30 |
13 files changed, 240 insertions, 40 deletions
@@ -1,15 +1,13 @@ [[source]] - url = "https://pypi.python.org/simple" verify_ssl = true name = "pypi" - [dev-packages] - - [packages] - -kubernetes = "*" +kubernetes = ">=1.0.0" sh = "*" +pbr = "!=2.1.0,>=2.0.0" +xtesting = "*" +redis = ">=2.10.0" diff --git a/Pipfile.lock b/Pipfile.lock index d840d68..cb6290c 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "3e773b6eb42a9dba3e5cb71bcac1c832939ab3b069641084d9f5ecd0967ce7cf" + "sha256": "c5dc0a028178f15ea550fb20c0d52aa410bc28a291d15e11018bcd1df6db2f4a" }, "pipfile-spec": 6, "requires": {}, @@ -35,6 +35,24 @@ ], "version": "==3.0.4" }, + "enum34": { + "hashes": [ + "sha256:2d81cbbe0e73112bdfe6ef8576f2238f2ba27dd0d55752a776c41d38b7da2850", + "sha256:644837f692e5f550741432dd3f223bbb9852018674981b1664e5dc339387588a", + "sha256:6bd0f6ad48ec2aa117d3d141940d484deccda84d4fcd884f5c3d93c23ecd8c79", + "sha256:8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1" + ], + "markers": "python_version == '2.7' or python_version == '2.6' or python_version == '3.3'", + "version": "==1.1.6" + }, + "funcsigs": { + "hashes": [ + "sha256:330cc27ccbf7f1e992e69fef78261dc7c6569012cf397db8d3de0234e6c937ca", + "sha256:a7bb0f2cf3a3fd1ab2732cb49eba4252c2af4240442415b4abce3b87022a8f50" + ], + "markers": "python_version < '3.3'", + "version": "==1.0.2" + }, "google-auth": { "hashes": [ "sha256:34088434cb2a2409360b8f3cbc04195a465df1fb2aafad71ebbded77cbf08803", @@ -57,16 +75,41 @@ }, "kubernetes": { "hashes": [ - "sha256:2f1a05a9bb2549d6afb6d138b2767d61d8aeb735a7a12bf554440524205e2894", - "sha256:f81f145882471a1dd9d23360e99bd77027f07744729ef2728af4af7130cd19fd" + "sha256:b370ab4abd925309db69a14a4723487948e9a83de60ca92782ec14992b741c89", + "sha256:c80dcf531deca2037105df09c933355c80830ffbf9e496b5e6a3967ac6809ef7" ], - "version": "==5.0.0" + "index": "pypi", + "version": "==6.0.0" + }, + "mock": { + "hashes": [ + "sha256:5ce3c71c5545b472da17b72268978914d0252980348636840bd34a00b5cc96c1", + "sha256:b158b6df76edd239b8208d481dc46b6afd45a846b7812ff0ce58971cf5bc8bba" + ], + "version": "==2.0.0" }, "oauthlib": { "hashes": [ - "sha256:ce57b501e906ff4f614e71c36a3ab9eacbb96d35c24d1970d2539bbc3ec70ce1" + "sha256:09d438bcac8f004ae348e721e9d8a7792a9e23cd574634e973173344046287f5", + "sha256:909665297635fa11fe9914c146d875f2ed41c8c2d78e21a529dd71c0ba756508" + ], + "version": "==2.0.7" + }, + "pbr": { + "hashes": [ + "sha256:4e8a0ed6a8705a26768f4c3da26026013b157821fe5f95881599556ea9d91c19", + "sha256:dae4aaa78eafcad10ce2581fc34d694faa616727837fd8e55c1a00951ad6744f" ], - "version": "==2.0.6" + "index": "pypi", + "version": "==4.0.2" + }, + "prettytable": { + "hashes": [ + "sha256:2d5460dc9db74a32bcc8f9f67de68b2c4f4d2f01fa3bd518764c69156d9cacd9", + "sha256:853c116513625c738dc3ce1aee148b5b5757a86727e67eff6502c7ca59d43c36", + "sha256:a53da3b43d7a5c229b5e3ca2892ef982c46b7923b51e98f0db49956531211c4f" + ], + "version": "==0.7.2" }, "pyasn1": { "hashes": [ @@ -104,10 +147,10 @@ }, "python-dateutil": { "hashes": [ - "sha256:07009062406cffd554a9b4135cd2ff167c9bf6b7aac61fe946c93e69fad1bbd8", - "sha256:8f95bb7e6edbb2456a51a1fb58c8dca942024b4f5844cae62c90aa88afe6e300" + "sha256:3220490fb9741e2342e1cf29a503394fdac874bc39568288717ee67047ff29df", + "sha256:9d8074be4c993fbe4947878ce593052f71dac82932a677d49194d8ce9778002e" ], - "version": "==2.7.0" + "version": "==2.7.2" }, "pyyaml": { "hashes": [ @@ -128,6 +171,14 @@ ], "version": "==3.12" }, + "redis": { + "hashes": [ + "sha256:8a1900a9f2a0a44ecf6e8b5eb3e967a9909dfed219ad66df094f27f7d6f330fb", + "sha256:a22ca993cea2962dbb588f9f30d0015ac4afcc45bee27d3978c0dbe9e97c6c0f" + ], + "index": "pypi", + "version": "==2.10.6" + }, "requests": { "hashes": [ "sha256:6a1b267aa90cac58ac3a765d067950e7dbbf75b1da07e895d1f594193a40a38b", @@ -142,6 +193,12 @@ ], "version": "==0.8.0" }, + "robotframework": { + "hashes": [ + "sha256:a5ffe9283c9247c3a1e81228fcc009819d8f94b48768170268a3e6274a998bca" + ], + "version": "==3.0.3" + }, "rsa": { "hashes": [ "sha256:25df4e10c263fb88b5ace923dd84bf9aa7f5019687b5e55382ffcdb8bede9db5", @@ -154,6 +211,7 @@ "sha256:ae3258c5249493cebe73cb4e18253a41ed69262484bad36fdb3efcb8ad8870bb", "sha256:b52bf5833ed01c7b5c5fb73a7f71b3d98d48e9b9b8764236237bdc7ecae850fc" ], + "index": "pypi", "version": "==1.12.14" }, "six": { @@ -176,6 +234,14 @@ "sha256:a453dc4dfa6e0db3d8fd7738a308a88effe6240c59f3226eb93e8f020c216149" ], "version": "==0.47.0" + }, + "xtesting": { + "hashes": [ + "sha256:0ccd7bfaf4d27cb93c3276dde7d94df97e8ccd25b73d91de7999b7a547d111f1", + "sha256:b0b1f1b4f9af0b4a80a70e5c1eba05aa25a81ecc57daec06e2498c8002f2681b" + ], + "index": "pypi", + "version": "==0.40.0" } }, "develop": {} diff --git a/clover/tracing/tracing.py b/clover/tracing/tracing.py index 16b952c..f646268 100644 --- a/clover/tracing/tracing.py +++ b/clover/tracing/tracing.py @@ -10,7 +10,7 @@ import time import redis TRACING_IP = "localhost" -TRACING_PORT = "30888" +TRACING_PORT = "16686" class Tracing: diff --git a/clover/tracing/validate.py b/clover/tracing/validate.py index 9cbfdd0..0f6f0a8 100644 --- a/clover/tracing/validate.py +++ b/clover/tracing/validate.py @@ -6,12 +6,11 @@ # http://www.apache.org/licenses/LICENSE-2.0 from kubernetes import client, config +import argparse from clover.tracing.tracing import Tracing +# from tracing import Tracing -JAEGER_IP = "localhost" -# JAEGER_IP = "1.1.1.1" -JAEGER_PORT = "30888" JAEGER_DEPLOYMENT = "jaeger-deployment" ISTIO_NAMESPACE = "istio-system" ISTIO_SERVICES = ["istio-ingress", "istio-mixer"] @@ -36,10 +35,12 @@ def validateDeploy(): validate = True return validate -# Services in Jaeger will only be present when traffic passes through Istio -# Requires a deployment in Istio service mesh with some traffic targeting nodes -def validateServices(): - t = Tracing(JAEGER_IP, JAEGER_PORT) + +# Services in Jaeger will only be present when traffic targets istio-ingress +# Even a failed HTTP GET request to istio-ingress will add istio-ingress and +# istio-mixer services +def validateServices(args): + t = Tracing(args['ip'], args['port']) services = t.getServices() validate = True if services: @@ -47,14 +48,20 @@ def validateServices(): if s in services: print("Service in tracing: {} present".format(s)) else: + print("Service in tracing: {} not present".format(s)) validate = False else: validate = False return validate -def main(): - if validateDeploy() and validateServices(): +def main(args): + vdeploy = validateDeploy() + if args['s']: + vservice = validateServices(args) + else: + vservice = True + if vdeploy and vservice: print"Jaeger tracing validation has passed" return True else: @@ -63,4 +70,16 @@ def main(): if __name__ == '__main__': - main() + parser = argparse.ArgumentParser() + parser.add_argument( + '-s', action='store_true', + help='Validate istio services, \ + which requires at least one http request to istio-ingress') + parser.add_argument( + '-ip', default='localhost', + help='IP address to access Jaeger') + parser.add_argument( + '-port', default='16686', + help='Port to acccess Jaeger') + args = parser.parse_args() + main(vars(args)) diff --git a/docker/Dockerfile b/docker/Dockerfile index c2dcd84..daed730 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -8,6 +8,7 @@ FROM ubuntu:16.04 LABEL image=opnfv/clover ARG BRANCH=master +ARG ISTIO_VERSION=0.6.0 # GIT repo directory ENV REPOS_DIR="/home/opnfv/repos" diff --git a/docker/setup.sh b/docker/setup.sh index 459f44b..639ced4 100755 --- a/docker/setup.sh +++ b/docker/setup.sh @@ -16,11 +16,13 @@ if [ "x${ISTIO_VERSION}" = "x" ] ; then grep tag_name | sed "s/ *\"tag_name\": *\"\(.*\)\",*/\1/") fi -ISTIO_DIR_NAME="istio-$ISTIO_VERSION" +mkdir istio-source -cd /usr/local/ -curl -L https://git.io/getLatestIstio | sh - -mv $ISTIO_DIR_NAME istio-source +curl -L https://github.com/istio/istio/releases/download/${ISTIO_VERSION}/istio-${ISTIO_VERSION}-linux.tar.gz | \ +tar xz -C istio-source --strip-components 1 + +# Install istioctl +cp istio-source/bin/* /usr/local/bin # Install kubectl curl -s http://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - @@ -33,6 +35,5 @@ apt-get update \ && apt-get -y autoremove \ && apt-get clean -# Persistently append istioctl bin path to PATH env -echo 'export PATH="$PATH:/usr/local/istio-source/bin"' >> ~/.bashrc +# Enable kubectl bash completion echo "source <(kubectl completion bash)" >> ~/.bashrc diff --git a/docs/development/design/tracing.rst b/docs/development/design/tracing.rst index 79d686c..b83274c 100644 --- a/docs/development/design/tracing.rst +++ b/docs/development/design/tracing.rst @@ -13,20 +13,26 @@ following command:: kubectl apply -n istio-system -f https://raw.githubusercontent.com/jaegertracing/jaeger-kubernetes/master/all-in-one/jaeger-all-in-one-template.yml The standard Jaeger REST port is at 16686. To make this service available outside of the -Kubernetes cluster, use the following command:: +Kubernetes cluster via any node IP in the cluster, use the following command:: kubectl expose -n istio-system deployment jaeger-deployment --port=16686 --type=NodePort -Kubernetes will expose the Jaeger service on another port, which can be found with:: +Kubernetes will expose the Jaeger service on another port from 30000-32767 and the assignment can +be found with:: kubectl get svc -n istio-system An example listing from the command above is shown below where the Jaeger service is exposed -externally on port 30888:: +externally on port 30888 in this case:: istio-system jaeger-deployment NodePort 10.104.113.94 <none> 16686:30888/TCP -Jaeger will be accessible using the host IP of the Kubernetes cluster and port provided. +Jaeger will be accessible using the host IP of any node in Kubernetes cluster and port provided. +With this method, the Jaeger UI will also be available from a remote host. If external access is +required to Jaeger but restricted to cluster localhost(s), an alternate method is to use the +**port-forward** command in the foreground, as shown below:: + + kubectl -n istio-system port-forward $(kubectl -n istio-system get pod -l app=jaeger -o jsonpath='{.items[0].metadata.name}') 16686:16686 ******** Validate @@ -40,5 +46,6 @@ It validates the installation with the following criteria: #. Existence of Jaeger all-in-one deployment using Kubernetes #. Jaeger service is accessible using IP address and port configured in installation steps -#. Jaeger can retrieve default service listing for default Istio components -#. TBD - consider installation of production setup with cassandra or elastic search +#. Optionally, if Jaeger can retrieve service listing for default Istio components + (istio-ingress, istio-mixer). At least one HTTP request must be sent to istio-ingress + after initial Jaeger deployment for this validation to function. diff --git a/docs/release/release-notes/index.rst b/docs/release/release-notes/index.rst new file mode 100644 index 0000000..1c41113 --- /dev/null +++ b/docs/release/release-notes/index.rst @@ -0,0 +1,15 @@ +.. _clover-releasenotes: + +.. This work is licensed under a Creative Commons Attribution 4.0 International +.. License. +.. http://creativecommons.org/licenses/by/4.0 +.. (c) OPNFV, Authors of Clover + +================================= +OPNFV Clover Design Specification +================================= + +.. toctree:: + :maxdepth: 1 + + Fraser-release-notes diff --git a/docs/release/userguide/index.rst b/docs/release/userguide/index.rst new file mode 100644 index 0000000..41fcb1f --- /dev/null +++ b/docs/release/userguide/index.rst @@ -0,0 +1,13 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International +.. License. +.. http://creativecommons.org/licenses/by/4.0 +.. (c) OPNFV, Authors of Clover + +================================= +OPNFV Clover Design Specification +================================= + +.. toctree:: + :maxdepth: 1 + + Fraser-userguide diff --git a/requirements.txt b/requirements.txt index c84c18f..f40583f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,8 @@ # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -kubernetes # Apache-2.0 +kubernetes>=5.0.0 # Apache-2.0 pbr!=2.1.0,>=2.0.0 # Apache-2.0 sh # MIT xtesting # Apache-2.0 -redis # MIT +redis>=2.10.0 # MIT diff --git a/samples/scenarios/clean.sh b/samples/scenarios/clean.sh new file mode 100755 index 0000000..bf4a7af --- /dev/null +++ b/samples/scenarios/clean.sh @@ -0,0 +1,28 @@ +#!/bin/bash +# +# Copyright (c) Authors of Clover +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# + +CLOVER_BASE_DIR=${CLOVER_BASE_DIR:-"/home/opnfv/repos/clover"} +ISTIO_BASE_DIR=${ISTIO_BASE_DIR:-"/istio-source"} + +cd $CLOVER_BASE_DIR + +echo "Deleting Service Delivery Controller sample scenario" + +kubectl delete -f ./samples/scenarios/service_delivery_controller_opnfv.yaml + +echo "Deleting Istio" + +kubectl delete -f $ISTIO_BASE_DIR/install/kubernetes/istio.yaml + +echo "Deleting Prometheus monitoring and Jaeger Tracing" + +kubectl delete -n istio-system -f https://raw.githubusercontent.com/jaegertracing/jaeger-kubernetes/master/all-in-one/jaeger-all-in-one-template.yml + +kubectl delete -f $ISTIO_BASE_DIR/install/kubernetes/addons/prometheus.yaml diff --git a/samples/scenarios/deploy.sh b/samples/scenarios/deploy.sh new file mode 100755 index 0000000..1ffea37 --- /dev/null +++ b/samples/scenarios/deploy.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# +# Copyright (c) Authors of Clover +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# + +CLOVER_BASE_DIR=${CLOVER_BASE_DIR:-"/home/opnfv/repos/clover"} +ISTIO_BASE_DIR=${ISTIO_BASE_DIR:-"/istio-source"} + +cd $CLOVER_BASE_DIR + +echo "Deploying Istio manual sidecar injection without TLS authentication" + +kubectl apply -f $ISTIO_BASE_DIR/install/kubernetes/istio.yaml + +echo "Deploying Service Delivery Controller sample scenario" + +kubectl apply -f <(istioctl kube-inject --debug -f ./samples/scenarios/service_delivery_controller_opnfv.yaml) diff --git a/samples/scenarios/view.sh b/samples/scenarios/view.sh new file mode 100755 index 0000000..8b155ce --- /dev/null +++ b/samples/scenarios/view.sh @@ -0,0 +1,30 @@ +#!/bin/bash +# +# Copyright (c) Authors of Clover +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +# + +CLOVER_BASE_DIR=${CLOVER_BASE_DIR:-"/home/opnfv/repos/clover"} +ISTIO_BASE_DIR=${ISTIO_BASE_DIR:-"/istio-source"} + +cd $CLOVER_BASE_DIR + +echo "Deploying Prometheus monitoring" + +kubectl apply -f $ISTIO_BASE_DIR/install/kubernetes/addons/prometheus.yaml + +echo "Deploying Jaeger tracing" + +kubectl apply -n istio-system -f https://raw.githubusercontent.com/jaegertracing/jaeger-kubernetes/master/all-in-one/jaeger-all-in-one-template.yml + +echo "Exposing tracing and monitoring outside of Kubernetes cluster" + +kubectl delete -n istio-system svc prometheus + +kubectl expose -n istio-system deployment jaeger-deployment --port=16686 --type=NodePort + +kubectl expose -n istio-system deployment prometheus --port=9090 --type=NodePort |