Failure to 'juju add-model' silently installs to a subtly broken model
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Triaged
|
Low
|
Unassigned |
Bug Description
Overview:
When configuring juju for k8s, failure to `juju add-model` doesn't prevent app installation, but instead installs to a model called `controller`, and in the same k8s namespace as the controller.
To reproduce:
$ juju version
2.9-
$ juju add-k8s gke
$ juju bootstrap gke
$ deploy cs:~postgresql-
$ juju status
Model Controller Cloud/Region Version SLA Timestamp
controller gke-us-central1 gke/us-central1 2.9-rc6 unsupported 12:19:36+01:00
App Version Status Scale Charm Store Rev OS Address Message
postgresql waiting 0/1 postgresql-k8s charmstore 8 kubernetes installing agent
Unit Workload Agent Address Ports Message
postgresql/0* waiting allocating agent initializing
$ kubectl get pods -A
NAMESPACE NAME READY STATUS RESTARTS AGE
controller-
controller-
controller-
kube-system event-exporter-
< ... snip ... >
What I would expect instead:
1. An error from `juju deploy` telling me that there is no model configured, so I need to do that first.
2. Alternately, if a default model makes sense, it probably needs a better name than `controller`, or at the very least, it should deploy applications to a `controller` namespace, to be consistent.
summary: |
- Failure to 'juju add-model' silently leads to a broken installation + Failure to 'juju add-model' silently installs to a subtly broken model |
The controller model is a legitimate model which holds to core Juju management infrastructure, but can host applications if desired. In Juju 2 we automatically create a "default" model when bootstrapping but are moving away from this behaviour for Juju 3 so that it behaves in the same way as it does now for k8s, ie do not create an arbitrary model. The user is expected to create whatever model they want to deploy things to explicitly after bootstrap. We got lots of feedback that the current (non k8s) behaviour is confusing and/or undesired. After bootstrap finishes, there is messaging (on k8s) telling the user they should add-model, so doesn't that cover point 1?
The reason the namespace is not just "controller" is because the cluster can be shared by several users and they can't all use the namespace "controller", so we need to disambiguate with the name of the controller.