{ "info": { "author": "CloudFxLabs", "author_email": "gswaroop@cloudfxlabs.io", "bugtrack_url": null, "classifiers": [], "description": "python-autoqube_kubernetes\n==========================\n\nThis library contains:\n\n- Objects for\n * Creating, updating and deleting a Kubernetes cluster.\n * Deploying various objects on Kubernetes cluster.\n * Running Jmeter Load tests on Kubernetes cluster.\n\n\n**Table of Contents**\n\n.. contents::\n :backlinks: none\n :local:\n\nInstallation\n------------\n\npython-autoqube_kubernetes is compatible with Python 3.x. It is listed on `PyPi as 'autoqube_kubernetes'`_. The recommended way to install is via pip_:\n\n.. code::\n\n pip install autoqube_kubernetes\n\n.. _PyPi as 'autoqube_kubernetes': https://pypi.python.org/pypi/autoqube_kubernetes/\n.. _pip: http://www.pip-installer.org\n\nPrerequisites\n-------------\n- **kops**: kops is a command line utility tool required to manage kubernetes cluster. The installation information is available at `kops installation`_.\n- **kubectl**: kubectl is a command line utility tool required to manage various objects on existing kubernetes cluster. The installation information is available at `kubectl installation`_.\n- **dns-zone**: A public hosted zone should be created for AWS which would be the same as the name of the cluster. Please refer `creating dns-zone`_.\n\n.. _kops installation: https://github.com/kubernetes/kops/blob/master/docs/install.md\n.. _kubectl installation: https://kubernetes.io/docs/tasks/tools/install-kubectl/\n.. _creating dns-zone: https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/CreatingHostedZone.html\n\nKubernetesHandler\n-----------------\nKubernetesHandler object will create, delete cluster and run load tests.\n\nKubernetes cluster\n~~~~~~~~~~~~~~~~~~\nCurrently the cluster creation is supported only on AWS cloud platform.\n\nFor creating a new Kubernetes cluster, the following parameters are needed:\n\n- cloud_provider : The cloud provider on which the cluster needs to be created.\n- cluster_config : The configuration details for the cluster.\n- env_config : The environment configuration for storage of cloud provider essential keys.\n\nA typical cluster configuration file would be like\n\n.. code-block:: python\n\n config = {\n \"cloud_provider\": \"AWS\",\n \"cluster_config\": {\n 'node-count': 2,\n 'master-size': 't2.small',\n 'master-zones': 'us-west-2a',\n 'zones': 'us-west-2a',\n 'name': 'aq.autoqube.io',\n 'node-size': 't2.small',\n 'ssh-public-key': '/Users/autoqube/.ssh/id_rsa.pub',\n 'dns-zone': 'aq.autoqube.io',\n },\n \"env_config\": {\n 'AWS_ACCESS_KEY_ID': '*********************',\n 'AWS_SECRET_ACCESS_KEY': '***********************',\n 'AWS_REGION': 'us-west-2',\n 'KUBECONFIG': '/Users/autoqube/kubernetes/aq.autoqube.io/kubeconfig',\n 'KOPS_STATE_STORE': 's3://agent-kops-store'\n },\n }\n\n*For better understanding or debugging of various processes running behind, setup a logging functionality.*\n\n.. code-block:: python\n\n from autoqube_kubernetes import KubernetesHandler\n import config\n import logging\n\n root_logger = logging.getLogger()\n console_handler = logging.StreamHandler()\n\n root_logger.setLevel(logging.INFO)\n root_logger.addHandler(console_handler)\n\n kubernetes_handler = KubernetesHandler(config)\n kubernetes_handler.create_cluster() # Creation of cluster with the above configuration.\n # kubeconfig will be stored in the path specified in the configuration.\n kubernetes_handler.delete_cluster() # Deletion of cluster with the above configuration.\n\nLoad Testing\n~~~~~~~~~~~~\n- Currently only 'jmeter' load testing is supported on kubernetes cluster.\n- Load testing using jmeter on a kubernetes cluster has been inspired from the following `blog`_.\n- The results of the load test can be visually seen on grafana service dashboards.\n- The templates for deployment of various kubernetes objects required for jmeter load testing can be downloaded from `Jmeter Load Test Templates`_.\n- Extract the downloaded templates and place them in location accessible by python.\n- The following parameters are needed for load testing\n * load_config - The configuration details about type of load test and the templates for kubernetes objects.\n * test_file_config - The configuration details about the test files for load test.\n\nA sample configuration would be like\n\n.. code-block:: python\n\n load_config = {\n 'test_type': 'jmeter',\n 'templates_path': '/Users/autoqube/kubernetes/load_testing/k8s_templates/jmeter/'\n }\n test_file_config = {\n 'test_files': ['./tmp/sample.jmx', './tmp/sample.csv']\n }\n\n\n.. _blog: https://blog.kubernauts.io/load-testing-as-a-service-with-jmeter-on-kubernetes-fc5288bb0c8b\n.. _Jmeter Load Test Templates: https://drive.google.com/file/d/1egtHVMALE3FzwFZ6OJO9ZiR678mvvaaY/\n\nKubernetesHandler will create the necessary objects on cluster and run load tests.\n\n.. code-block:: python\n\n # After creation of kubernetes cluster using 'kubernetes_handler'.\n kubernetes_handler.create_load_test(load_config)\n # Creates pods, deployments, services and other objects required for\n # load testing on cluster.\n\n kubernetes_handler.run_load_test(test_file_config)\n # Run load tests using the test files provided in the configuration\n\n kubernetes_handler.destroy_load_test(load_config)\n # Once the tests are complete, all the resources created can be destroyed\n # and only empty cluster will remain.\n\nKubernetesClient\n----------------\nKubernetesClient can be used to perform various actions on existing cluster like:\n * Creating objects from yaml files\n * Destroying resources on cluster\n * Listing all the pods and services on cluster\n * Executing commands on a specific pod\n * Copy files to a specific pod\n\nkubeconfig of a cluster is required.\n\n.. code-block:: python\n\n from autoqube_kubernetes import KubernetesClient\n\n kubernetes_client = KubernetesClient('/path/to/kubeconfig')\n namespace = 'autoqube' # Namespace on which the operations are to be performed.\n kubernetes_client.create_object('/path/to/yaml', namespace) # Creates object from yaml file.\n kubernetes_client.get_pod_list(namespace) # Lists all the pods.\n kubernetes_client.get_service_list(namespace) # Lists all the services.\n podname = 'autoqube-jmeter'\n commands_list = ['cd ~', 'ls']\n kubernetes_client.execute_commands(podname, commands_list, namespace) # Executes the commands on a specific pod.\n kubernetes_client.destroy_all_resources(namespace) # Destroys all resources in a given namespace.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gitlab.com/autoqube/aq-kubernetes", "keywords": "kubernetes jmeter", "license": "BSD 3", "maintainer": "CloudFxLabs", "maintainer_email": "gswaroop@cloudfxlabs.io", "name": "autoqube-kubernetes", "package_url": "https://pypi.org/project/autoqube-kubernetes/", "platform": "", "project_url": "https://pypi.org/project/autoqube-kubernetes/", "project_urls": { "Homepage": "https://gitlab.com/autoqube/aq-kubernetes" }, "release_url": "https://pypi.org/project/autoqube-kubernetes/1.0.2/", "requires_dist": [ "kubernetes", "pymongo", "pyyaml" ], "requires_python": "", "summary": "Kubernetes Handler module for AUTOQUBE load testing", "version": "1.0.2" }, "last_serial": 4838272, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "6ffbbaf8f73aafd8266d1d5e35f0e9d9", "sha256": "9a8469c873701f8a0eba8a7164e488ad777d7e04aed46b4079dbcca736e4b9bf" }, "downloads": -1, "filename": "autoqube_kubernetes-1.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "6ffbbaf8f73aafd8266d1d5e35f0e9d9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 12960, "upload_time": "2019-02-01T09:34:08", "url": "https://files.pythonhosted.org/packages/4e/e3/341d4f536f5ac05f5092f49c668dd2aa18d52eefa003e686a50c25ee8c64/autoqube_kubernetes-1.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9db9272a15c981f6a363f6d91be7c040", "sha256": "7e499bc1b4ad28c2fded8370fabc1e3f7f80a57d3203fb03c568e72d0d2a3b17" }, "downloads": -1, "filename": "autoqube_kubernetes-1.0.1.tar.gz", "has_sig": false, "md5_digest": "9db9272a15c981f6a363f6d91be7c040", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9679, "upload_time": "2019-02-01T09:34:10", "url": "https://files.pythonhosted.org/packages/20/dc/694a6cc267fa8f510412a0d9524e82fae40046a772030e5a8fe8a37e9746/autoqube_kubernetes-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "3fe97d0f946a56e9a6e1b121b00c2b00", "sha256": "fe39f17f0e465596b1dc56ae26152446fd7769c20d745405b853b78d92743d66" }, "downloads": -1, "filename": "autoqube_kubernetes-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "3fe97d0f946a56e9a6e1b121b00c2b00", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13075, "upload_time": "2019-02-19T06:34:28", "url": "https://files.pythonhosted.org/packages/5e/a6/fe90a312d64ce13c02626c840f4f6aa24fbc3e00759f7a6b468b87e50319/autoqube_kubernetes-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9623f7388ec6a3823dab7f6f27712238", "sha256": "cccd9367987169790065115b6bfde19dcca1f47ccb3ed6c848c1a427553f039d" }, "downloads": -1, "filename": "autoqube_kubernetes-1.0.2.tar.gz", "has_sig": false, "md5_digest": "9623f7388ec6a3823dab7f6f27712238", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9800, "upload_time": "2019-02-19T06:34:30", "url": "https://files.pythonhosted.org/packages/1a/01/867d775782aae79fa06092ba28c7d01e6111a36febe9391fff5ffc9b365c/autoqube_kubernetes-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3fe97d0f946a56e9a6e1b121b00c2b00", "sha256": "fe39f17f0e465596b1dc56ae26152446fd7769c20d745405b853b78d92743d66" }, "downloads": -1, "filename": "autoqube_kubernetes-1.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "3fe97d0f946a56e9a6e1b121b00c2b00", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13075, "upload_time": "2019-02-19T06:34:28", "url": "https://files.pythonhosted.org/packages/5e/a6/fe90a312d64ce13c02626c840f4f6aa24fbc3e00759f7a6b468b87e50319/autoqube_kubernetes-1.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9623f7388ec6a3823dab7f6f27712238", "sha256": "cccd9367987169790065115b6bfde19dcca1f47ccb3ed6c848c1a427553f039d" }, "downloads": -1, "filename": "autoqube_kubernetes-1.0.2.tar.gz", "has_sig": false, "md5_digest": "9623f7388ec6a3823dab7f6f27712238", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9800, "upload_time": "2019-02-19T06:34:30", "url": "https://files.pythonhosted.org/packages/1a/01/867d775782aae79fa06092ba28c7d01e6111a36febe9391fff5ffc9b365c/autoqube_kubernetes-1.0.2.tar.gz" } ] }