2a6dde27df
Summary of changes: - Remove pinnings for pip, virtualenv, setuptools - Add py312 section to tox.ini [testenv] - Removed test dependency on retired sunbeam-ops repo - Updated zuul.yaml to use openstack-python3-charm-jobs Change-Id: I289118ce34583e511c52847613a2bd2694d45ae3 |
||
---|---|---|
lib/charms | ||
src | ||
templates | ||
tests | ||
unit_tests | ||
.flake8 | ||
.gitignore | ||
.gitreview | ||
.jujuignore | ||
.stestr.conf | ||
.zuul.yaml | ||
actions.yaml | ||
build-requirements.txt | ||
charmcraft.yaml | ||
config.yaml | ||
LICENSE | ||
metadata.yaml | ||
osci.yaml | ||
README.md | ||
rename.sh | ||
requirements.txt | ||
run_tests | ||
test-requirements.txt | ||
tox.ini |
Cloudkitty
Cloudkitty charm - Openstack Rating as a Service
Overview
This charm provides a way to deploy Cloudkitty - Openstack Rating as a Service module - in Openstack
What is CloudKitty ?
CloudKitty is a generic solution for the chargeback and rating of a cloud. Provides a metric-based rating for cloud administrators allowing them to create rating rules to the collected data.
CloudKitty usage
With Cloudkitty, it is possible to:
- Collect metrics from OpenStack (through Gnocchi).
- Apply rating rules to the previous metrics.
- Retrieve the rated information, grouped by scope and/or by metric type.
However, it is not possible to:
- Limit resources in other OpenStack services.
- Add taxes, convert between currencies, etc...
CloudKitty associates a price to a metric for a given period, the price is mapped according to end-user needs.
Configuration
Cloudkitty charm configuration options
debug
to run service in debug mode change debug config valuejuju config cloudkitty debug=true
region
set the openstack cloud region, if value required to be changed preferably to specify in a bundlecloudkitty: charm: ch:cloudkity options: region: MyRegion
To display all configuration option information run juju config cloudkitty
. If the application is not deployed then see the charm's
configuration file.
Deployment
Deploy cloudkitty charm
juju deploy cloudkitty --channel edge
Or in a bundle
applications:
cloudkitty:
charm: ch:cloudkitty
channel: edge
num_units: 1
series: jammy
Relations
Cloudkitty charm supports the following relations.
MySQL relation - relation to mysql-operator charm - provides database storage for the cloudkitty service.
NOTE: This charm is not backward compatible with legacy mysql-innodb-cluster
charm
juju deploy mysql --channel edge
juju relate cloudkitty mysql
Keystone relation - provides identity management.
juju deploy keystone
juju relate cloudkitty keystone
Gnocchi relation - provides metrics collector service.
juju deploy gnocchi
juju relate cloudkitty gnocchi
RabbitMQ relation - provides messages queue service.
juju deploy rabbitmq-server
juju relate cloudkitty rabbitmq-server
Actions
This section lists Juju actions supported by the charm. Actions allow specific operations to be performed on a per-unit basis.
-
restart-services
restartscloudkitty-{api,processor}
services in the unit.juju run-action --wait cloudkitty/leader restart-services
Usage
To interact with the service we should use the built-in openstack cloudkitty client in the openstackclients package
Check clients usage like this
openstack rating --help
First enable hashmap
module
$ openstack rating module enable hashmap
Then start by creating a service called image for example
$ openstack rating hashmap service create image
Create a field called flavor_id
as an example, and associate it with the service using the service ID
$ openstack rating hashmap field create <SERVICE_ID> flavor_id
Map the field with a value of the specific field, a flavor id
$ openstack flavor list
+---------+-----------+-------+------+-----------+-------+-----------+
| ID | Name | RAM | Disk | Ephemeral | VCPUs | Is Public |
+---------+-----------+-------+------+-----------+-------+-----------+
| 123abc | m1.tiny | 512 | 8 | 40 | 1 | True |
+---------+-----------+-------+------+-----------+-------+-----------+
Create the mapping of type flat
and let's assign a cost of 1.2
$ openstack rating hashmap mapping create --type flat --field-id <FIELD_ID> --value 123abc 1.2
Finally check the summary report
$ openstack rating summary get
TO-DO
This charm is under development not yet stable, the following list provides pending features
-
Enable TLS support using [TLS interface]
-
InfluxDB relation required for storage v2
-
Cloudkitty dashboard charm relation
-
High availability
Contributing
Please see the Juju SDK docs for guidelines
on enhancements to this charm following best practice guidelines, and
CONTRIBUTING.md
for developer guidance.
Follow Openstack best practices for Software contributions in charm development.
Bugs
Please report bugs on Launchpad.
For general charm questions refer to the OpenStack Charm Guide.