Capsule

  • By Clastix Labs
Channel Revision Published Runs on
latest/stable 1 29 Apr 2022
Ubuntu 20.04
juju deploy capsule-k8s
Show information

Platform:

The code for this charm can be downloaded as follows:

git clone https://github.com/clastix/capsule-k8s-charm

Setup

A typical setup using snaps, for deployments to a microk8s cluster can be done using the following commands.

Install the dependencies:

sudo snap install juju --classic
sudo snap install microk8s --classic
microk8s.enable dns storage

Create a controller named micro into the cloud microk8s:

juju bootstrap microk8s micro

In Juju, you interact with the client (the juju command on your local machine). It connects to a controller. The controller is hosted on a cloud and controls models.

juju add-model capsule-system

Then you build and deploy this charm into the model you just created:

charmcraft build
juju deploy --trust ./charm-k8s-capsule.charm --resource capsule-image=clastix/capsule:v0.1.1

To check it you run:

juju status

Development

Create and activate a virtualenv with the development requirements:

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

Now build the charm again and upgrade it through juju:

charmcraft build
juju upgrade-charm --path="./charm-k8s-capsule.charm" charm-k8s-capsule --force-units

Alternatively, you can completely clean up the environment:

juju remove-application charm-k8s-capsule --force --no-wait
juju destroy-model capsule-system --destroy-storage --force --no-wait
juju destroy-controller micro --destroy-all-models