Skip to content

Container Storage Interface (CSI) plugin that enables ceph as a storage backend

License

Notifications You must be signed in to change notification settings

asbalderson/ceph-csi-operator

 
 

Repository files navigation

ceph-csi

Description

This is a subordinate charm of kubernetes-control-plane, deployed as part of Charmed Kubernetes and enables a Kubernetes cluster to use Ceph as a storage backend. Currently supported storage options are ceph-xfs and ceph-ext4 with cephfs being work in progress.

Note: This charm creates various Kubernetes resources, including pods. Therefore it requires kubernetes-control-plane to run in privileged mode (config option allow-privileged=true)

Usage

As this charm has no standalone functionality, we'll need Kubernetes and Ceph cluster first.

$ juju deploy charmed-kubernetes
$ juju config kubernetes-control-plane allow-privileged=true
$ juju deploy -n 3 ceph-mon
$ juju deploy -n 3 ceph-osd
$ juju add-relation ceph-osd ceph-mon

Once the deployment settled, We can add ceph-csi

$ juju deploy ceph-csi
$ juju add-relation ceph-csi kubernetes-control-plane
$ juju add-relation ceph-csi ceph-mon

Warning: Removal

When the ceph-csi charm is removed, it will not clean up Ceph pools that were created when the relation with ceph-mon:client was joined. The interface of ceph-mon:client does not seem to offer a "removal" functionality. If you wish to remove ceph pools, use delete-pool action of ceph-mon unit.

Developing

Create and activate a virtualenv with the development requirements:

virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements-dev.txt

Testing

The Python operator framework includes a very nice harness for testing operator behaviour without full deployment. To execute unit tests, run:

$ tox -e unit

This charm contains functional tests which fully deploy the ceph-csi charm along with kubernetes and ceph cluster to test its functionality in a real environment. There are a few ways to run functional tests

$ tox -e func                          # Deploys new juju model and runs tests
$ tox -e func -- --model <model_name>  # Runs tests against existing model
$ tox -e func -- --keep-models         # Does not tear down model after tests are done (usefull for debuging failing tests )

NOTE: If the environment which runs functional tests is behind a http proxy, you must export TEST_HTTPS_PROXY environment variable. Otherwise Kubernetes might have problem fetching docker images. Example:

$ export TEST_HTTPS_PROXY=http://10.0.0.1:3128
$ tox -e func

About

Container Storage Interface (CSI) plugin that enables ceph as a storage backend

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.1%
  • Jinja 0.9%