Giter VIP home page Giter VIP logo

charm-kingfisher's Introduction

kingfisher

โšก Kingfisher is a test charm, and care should be taken when using it. It tries not to but may destroy the cloud you run it on.

Description

Kingfisher is a stress tester for OpenStack clouds. Is uses Cluster-API to deploy and destroy a Kubernetes workload cluster on the same OpenStack that's being used to deploy Kingfisher.

Usage

It is required to do a bit of setup on the cloud prior to running a benchmark with kingfisher, specifically it is required to build a ClusterAPI compaible image] and configure the charm to use that image, by name. A brief summary of the previous link that can help guide a deployer is below:

apt install qemu-kvm libvirt-daemon-system libvirt-clients virtinst cpu-checker libguestfs-tools libosinfo-bin unzip python3-pip
pip install ansible
git clone https://github.com/kubernetes-sigs/image-builder.git
cd image-builder/images/capi

cat >~/build-config.json <<EOL
{
    "http_proxy": "http://squid.internal:3128",
    "https_proxy": "http://squid.internal:3128"
}
EOL
export PACKER_VAR_FILES="/root/build-config.json"
export PATH="$PATH:/root/image-builder/images/capi/.local/bin"
make deps-qemu
make build-qemu-ubuntu-2004
openstack image create --disk-format=qcow2 --container-format=bare --file ~/ubuntu-2004-kube-v1.20.9 cluster-api

In the above example, the http_proxy and https_proxy should be configured with any local proxies that are needed.

In addition to the customised image, it is necessary to create an SSH key and then configure this charm to refer to it.

openstack keypair create --public-key ~/.ssh/id_rsa.pub cluster-api

Once you're ready to deploy a workload cluster, you can do so with the deploy action:

juju deploy kingfisher --constraints mem=4G --trust
juju run-action -m kingfisher --wait kingfisher/0 deploy

This action will take a while to finish or timeout (configurable), and then the workload cluster can be cleaned up with the destroy action:

juju run-action -m kingfisher --wait kingfisher/0 destroy

Troubleshooting

When a deployment fails, it's usually due to resource errors on the cloud. Kingfisher requires that Octavia is deployed in the cloud, and that an SSH key has been uploaded in the tenant that's being used for testing. To follow along with what ClusterAPI is doing, it's possible to tail the logs on the kingfisher node:

kubectl  -n capo-system logs -l control-plane=capo-controller-manager -c manager --follow

In the event that one machine has been created but then the deployment has stopped, it is possible to add security group rules to allow SSH, and add a route to the tenant's router, at which point the deployed SSH key can be used to connect to the control plane instance. The thing to look at on the instance is the cloud-init-output.log in /var/log.

Developing

Create and activate a virtualenv with the development requirements:

virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements-dev.txt
charmcraft build
juju deploy --resource kind=../kind --resource clusterctl=../clusterctl ./kingfisher.charm --constraints mem=4G --trust

Testing

The Python operator framework includes a very nice harness for testing operator behaviour without full deployment. Just run_tests:

./run_tests

charm-kingfisher's People

Contributors

chrismacnaughton avatar

Watchers

James Page avatar Alex Kavanagh avatar James Cloos avatar Corey Bryant avatar Billy Olsen avatar Liam Young avatar Frode Nordahl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.