|
| 1 | +.. image:: docs/_static/zelt.png |
| 2 | + :alt: Zelt logo |
| 3 | + |
| 4 | +Zalando end-to-end load tester |
| 5 | +****************************** |
| 6 | + |
| 7 | +.. image:: https://travis-ci.org/zalando-incubator/zelt.svg?branch=master |
| 8 | + :alt: travis-ci status badge |
| 9 | + :target: https://travis-ci.org/zalando-incubator/zelt |
| 10 | + |
| 11 | +.. image:: https://badgen.net/pypi/v/zelt |
| 12 | + :alt: pypi version badge |
| 13 | + :target: https://pypi.org/project/zelt |
| 14 | + |
| 15 | +.. image:: https://api.codacy.com/project/badge/Grade/a74dee2bbbd64da8951a3cec5059dda3 |
| 16 | + :alt: code quality badge |
| 17 | + :target: https://www.codacy.com/app/bmaher/zelt |
| 18 | + |
| 19 | +.. image:: https://api.codacy.com/project/badge/Coverage/a74dee2bbbd64da8951a3cec5059dda3 |
| 20 | + :alt: test coverage badge |
| 21 | + :target: https://www.codacy.com/app/bmaher/zelt |
| 22 | + |
| 23 | +.. image:: https://badgen.net/badge/code%20style/black/000 |
| 24 | + :alt: Code style: Black |
| 25 | + :target: https://github.com/ambv/black |
| 26 | + |
| 27 | +| |
| 28 | +
|
| 29 | +A **command-line tool** for orchestrating the deployment of |
| 30 | +Locust_ in Kubernetes_. |
| 31 | + |
| 32 | +Use it in conjunction with Transformer_ to run large-scale end-to-end |
| 33 | +load testing of your website. |
| 34 | + |
| 35 | +Prerequistes |
| 36 | +============ |
| 37 | + |
| 38 | +- `Python 3.6+`_ |
| 39 | + |
| 40 | +Installation |
| 41 | +============ |
| 42 | + |
| 43 | +Install using pip: |
| 44 | + |
| 45 | +.. code:: bash |
| 46 | +
|
| 47 | + pip install zelt |
| 48 | +
|
| 49 | +Usage |
| 50 | +===== |
| 51 | + |
| 52 | +Example HAR files, locustfile, and manifests are included in the |
| 53 | +``examples/`` directory, try them out. |
| 54 | + |
| 55 | +**N.B** The cluster to deploy to is determined by your currently |
| 56 | +configured context. Ensure you are `using the correct cluster`_ |
| 57 | +before using Zelt. |
| 58 | + |
| 59 | +Locustfile as input |
| 60 | +------------------- |
| 61 | + |
| 62 | +Zelt can deploy Locust with a locustfile to a cluster: |
| 63 | + |
| 64 | +.. code:: bash |
| 65 | +
|
| 66 | + zelt from-locustfile PATH_TO_LOCUSTFILE --manifests PATH_TO_MANIFESTS |
| 67 | +
|
| 68 | +HAR files(s) as input |
| 69 | +--------------------- |
| 70 | + |
| 71 | +Zelt can transform HAR file(s) into a locustfile and deploy it along |
| 72 | +with Locust to a cluster: |
| 73 | + |
| 74 | +.. code:: bash |
| 75 | +
|
| 76 | + zelt from-har PATH_TO_HAR_FILES --manifests PATH_TO_MANIFESTS |
| 77 | +
|
| 78 | +**N.B** This requires |
| 79 | +Transformer_ to be installed. For more information about Transformer, |
| 80 | +please refer to `Transformer's documentation`_. |
| 81 | + |
| 82 | +Rescale a deployment |
| 83 | +-------------------- |
| 84 | + |
| 85 | +Zelt can rescale the number of workers_ in a deployment it has made |
| 86 | +to a cluster: |
| 87 | + |
| 88 | +.. code:: bash |
| 89 | +
|
| 90 | + zelt rescale NUMBER_OF_WORKERS --manifests PATH_TO_MANIFESTS |
| 91 | +
|
| 92 | +Delete a deployment |
| 93 | +------------------- |
| 94 | + |
| 95 | +Zelt can delete deployments it has made from a cluster: |
| 96 | + |
| 97 | +.. code:: bash |
| 98 | +
|
| 99 | + zelt delete --manifests PATH_TO_MANIFESTS |
| 100 | +
|
| 101 | +Run Locust locally |
| 102 | +------------------ |
| 103 | + |
| 104 | +Zelt can also run Locust locally by providing the ``--local/-l`` flag to |
| 105 | +either the ``from-har`` or ``from-locustfile`` command e.g.: |
| 106 | + |
| 107 | +.. code:: bash |
| 108 | +
|
| 109 | + zelt from-locustfile PATH_TO_LOCUSTFILE --local |
| 110 | +
|
| 111 | +Use S3 for locustfile storage |
| 112 | +----------------------------- |
| 113 | + |
| 114 | +By default, Zelt uses a ConfigMap for storing the locustfile. ConfigMaps |
| 115 | +have a file-size limitation of ~2MB. If your locustfile is larger than |
| 116 | +this then you can use an S3 bucket for locustfile storage. |
| 117 | + |
| 118 | +To do so, add the following parameters to your Zelt command: |
| 119 | + |
| 120 | +- ``--storage s3``: Switch to S3 storage |
| 121 | +- ``--s3-bucket``: The name of your S3 bucket |
| 122 | +- ``--s3-key``: The name of the file as stored in S3 |
| 123 | + |
| 124 | +**N.B.** Zelt will *not* create the S3 bucket for you. |
| 125 | + |
| 126 | +**N.B.** Make sure to update your deployment manifest(s) to download the |
| 127 | +locustfile file from S3 instead of loading from the ConfigMap volume |
| 128 | +mount. |
| 129 | + |
| 130 | +Use a configuration file for Zelt options |
| 131 | +----------------------------------------- |
| 132 | + |
| 133 | +An alternative to specifying Zelt’s options on the command-line is to |
| 134 | +use a configuration file, for example: |
| 135 | + |
| 136 | +.. code:: bash |
| 137 | +
|
| 138 | + zelt from-har --config examples/config/config.yaml |
| 139 | +
|
| 140 | +**N.B.** The configuration file’s keys are the same as the command-line |
| 141 | +option names but without the double dash (``--``). |
| 142 | + |
| 143 | +Documentation |
| 144 | +============= |
| 145 | + |
| 146 | +Take a look at our documentation_ for more details. |
| 147 | + |
| 148 | +Contributing |
| 149 | +============ |
| 150 | + |
| 151 | +Please read `CONTRIBUTING.md <CONTRIBUTING.md>`__ for details on our |
| 152 | +process for submitting pull requests to us, and please ensure you follow |
| 153 | +the `CODE_OF_CONDUCT.md <CODE_OF_CONDUCT.md>`__. |
| 154 | + |
| 155 | +Versioning |
| 156 | +========== |
| 157 | + |
| 158 | +We use SemVer_ for versioning. |
| 159 | + |
| 160 | +Authors |
| 161 | +======= |
| 162 | + |
| 163 | +- **Brian Maher** - `@bmaher`_ |
| 164 | +- **Oliwia Zaremba** - `@tortila`_ |
| 165 | +- **Thibaut Le Page** - `@thilp`_ |
| 166 | + |
| 167 | +See also the list of `contributors <CONTRIBUTORS.md>`__ who participated |
| 168 | +in this project. |
| 169 | + |
| 170 | +License |
| 171 | +======= |
| 172 | + |
| 173 | +This project is licensed under the MIT License - see the |
| 174 | +`LICENSE <LICENSE>`__ file for details |
| 175 | + |
| 176 | +.. _Locust: https://locust.io/ |
| 177 | +.. _Kubernetes: https://kubernetes.io/ |
| 178 | +.. _Transformer: https://github.com/zalando-incubator/transformer |
| 179 | +.. _`Python 3.6+`: https://www.python.org/downloads/ |
| 180 | +.. _`using the correct cluster`: https://kubernetes.io/docs/reference/kubectl/cheatsheet/#kubectl-context-and-configuration |
| 181 | +.. _`Transformer's documentation`: https://transformer.readthedocs.io/ |
| 182 | +.. _workers: https://docs.locust.io/en/stable/running-locust-distributed.html |
| 183 | +.. _documentation: https://zelt.readthedocs.io/ |
| 184 | +.. _`@bmaher`: https://github.com/bmaher |
| 185 | +.. _`@tortila`: https://github.com/tortila |
| 186 | +.. _`@thilp`: https://github.com/thilp |
| 187 | +.. _SemVer: http://semver.org/ |
0 commit comments