Bundles now supported!

Juju 2.5 beta1 due out real soon now will support Kubernetes bundles. This includes:

  • deployment
  • export-bundle
  • diff-bundle

The feature landed in commit e204449 so you can also grab it early from the corresponding 2.5 edge snap once that builds.

A Kubernetes bundle is similar to a cloud bundle except for a few key differences:

  • bundle keyword is set to kubernetes (this is what denotes the bundle as a Kubernetes one)
  • use scale instead of num_units
  • use placement instead of to (placement is a set of key/value pairs used as a node selector)

A small example to get started:

bundle: kubernetes
applications:
  mariadb:
    charm: cs:~wallyworld/mariadb-k8s
    scale: 2
    constraints: mem=1G
    options:
        dataset-size: 70%
    storage:
      database: 20M,mariadb-pv
  gitlab:
    charm: cs:~wallyworld/gitlab-k8s
    placement: foo=bar
    scale: 1
relations:
  - - gitlab:mysql
    - mariadb:server

2 Likes

Haven’t tried it yet but this is great news, thanks Ian!

Is it possible to specify a local image as ocI resource?

I tried this:

    resources:
      consumer_image: "tutum/curl"

But it gives me the error ERROR cannot deploy bundle: filepath or registry path: /home/merlijn/<bundle directory>/tutum/curl not valid

This is indeed a bug - it will be fixed for rc1 next week.
The OCI image resource value for a local charm in the bundle should be the same as what’s used when deploying a local charm directly, eg

juju deploy /path/to/mariadb-k8s --resource mysql_image=wallyworld/mariadb:test

The image value is a standard docker path URL, so in the above example the image would need to exist on docker hub. If you want to use an image you’ve docker built locally, I think you’ll need to save that first to the register in your k8s cluster, eg for microk8s

docker save wallyworld/mariadb:test | microk8s.ctr -n k8s.io image import -

1 Like