A key difference with Kubernetes models vs vm based cloud models is how applications are scaled. On a traditional cloud, Juju has add/remove unit commands:
juju add-unit mariadb -n 3
juju remove-unit mariadb/2
The key behaviour is that Juju manages the units as named entities. Adding units creates new units with a unique number, and once created, specific units may then be selected for removal, or to have new storage attached, or to have storage detached etc.
Kubernetes works differently. Juju makes use of either a deployment or stateful set depending on whether storage is required. Individual pods are not managed as separate entities. All pods use a common storage configuration, memory and other resource limits etc. The scaling operation is done by requesting how many pods are to run, and Kubernetes will determine which pods to terminate (if any) to satisfy the request.
Juju uses a new
scale-application command to manage the number of units for a given application.
juju scale-application mariadb 4
will request that 4 mariadb units/pods be running. New pods are created if needed; any in excess are terminated. Kubernetes will decide how to perform the requested scaling operation and
juju status will reflect the outcome.
If you try and run add/remove-unit on a Kubernetes model you’ll get an error.