diff-bundle is a model command to show differences between a bundle and a model. This is really useful when you’re trying to see what changes might have been made in production over time that are different from the original bundle you started out with. You might also use this to snapshot updates to the bundle over time, especially if it’s in active development.
juju diff-bundle <bundle> --overlay <overlay-file> --map-machines <mapping or existing> --annotations
Some usage examples:
juju diff-bundle localbundle.yaml juju diff-bundle canonical-kubernetes juju diff-bundle -m othermodel hadoop-spark juju diff-bundle mongodb-cluster --channel beta juju diff-bundle canonical-kubernetes --overlay local-config.yaml --overlay extra.yaml juju diff-bundle localbundle.yaml --map-machines 3=4
This will compare the bundle (combined with any overlays) to the model, using the machine mapping provided, and display differences, considering (as a first pass):
- applications (missing or unexpected)
- unit counts (will need special handling for subordinates, where the bundle unit count will be zero)
- annotations (if the
--annotationsflag is specified - these are likely to be noisy)
In subsequent passes we’ll also diff placement, endpoint bindings and devices.
Here’s an example of diff-bundle output:
applications: etcd: num_units: bundle: 3 model: 5 kubernetes-master: charm: bundle: cs:~containers/kubernetes-master-150 model: cs:~containers/kubernetes-master-144 constraints: bundle: cores=2 mem=4G root-disk=16G model: cores=2 mem=4G root-disk=8G options: channel: bundle: 1.11/stable model: 1.11/beta other_option: bundle: value model: kubeapi-load-balancer: missing: model machines: "0": series: bundle: xenial model: bionic "1": missing: bundle relations: bundle-additions: - - kubernetes-master:kube-api-endpoint - kubeapi-load-balancer:apiserver - - etcd:certificates - easyrsa:client model-additions: - - flannel:etcd - etcd:db