Package: chaostoolkit-cloud-foundry
Chaos Toolkit Cloud Foundry ExtensionThis extension package provides probes and actions for Chaos Engineering
experiments against a Cloud Foundry instance using theChaos Toolkit.InstallThis package requires Python 3.7+To be used from your experiment, this package must be installed in the Python
environment wherechaostoolkitalready lives.$ pip install -U chaostoolkit-cloud-foundryUsageTo use the probes and actions from this package, add a similar payload to your
experiment file:{"type":"action","name":"terminate-random-instance","provider":{"type":"python","module":"chaoscf.probes","func":"terminate_some_random_instance","arguments":{"name":"my-app","org_name":"my-org","space_name":"my-space"}}},{"type":"probe","name":"fetch-app-statistics","provider":{"type":"python","module":"chaoscf.probes","func":"get_app_stats","arguments":{"name":"my-app","org_name":"my-org","space_name":"my-space"}}}That's it!Please explore the code to see existing probes and actions.DiscoveryYou may use the Chaos Toolkit to discover the capabilities of this extension:$ chaos discover chaostoolkit-cloud-foundry --no-installIf you have logged in against a Cloud Foundry environment, this will discover
information about it along the way.ConfigurationThis extension to the Chaos Toolkit need credentials to a Cloud Foundry account
with appropriate scopes. Please add the following sections to your experiment
file:{"configuration":{"cf_api_url":"https://api.local.pcfdev.io","cf_verify_ssl":false},"secrets":{"cloudfoundry":{"cf_username":"user","cf_password":"pass"}}}You may leave"cf_verifiy_ssl"out of the configuration when you want to
verify TLS certificates. Usually, local environments are self-signed so it
may be useful to disable that check in that case.You may also specify the"cf_client_id"and"cf_client_secret"secrets
when you need. Their default values are"cf"and""respectively. These
work well against a localPCF devinstall.Then in your probe or action:{"type":"probe","name":"fetch-app-statistics","provider":{"type":"python","secrets":["cloudfoundry"],"module":"chaoscf.probes","func":"get_app_stats","arguments":{"name":"my-app","org_name":"my-org","space_name":"my-space"}}}TestTo run the tests for the project execute the following:$ pip install -r requirements-dev.txt
$ pytestContributeIf you wish to contribute more functions to this package, you are more than
welcome to do so. Please, fork this project, make your changes following the
usualPEP 8code style, sprinkling with tests and submit a PR for
review.The Chaos Toolkit project requires all contributors must sign aDeveloper Certificate of Originon each commit they would like to merge
into the master branch of the repository. Please, make sure you can abide by
the rules of the DCO before submitting a PR.DevelopIf you wish to develop on this project, make sure to install the development
dependencies. But first,create a virtual environmentand then install
those dependencies.$pipinstall-rrequirements-dev.txt-rrequirements.txtThen, point your environment to this directory:$pythonsetup.pydevelopNow, you can edit the files and they will be automatically be seen by your
environment, even when running from thechaoscommand locally.TestTo run the tests for the project execute the following:$ python setup.py test