Controller running in LXD fails to deploy workloads in Microk8s cloud. Invalid storage name

Bug #2031216 reported by Martin Kalcok
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Triaged
High
Yang Kelvin Liu

Bug Description

I have a host running LXD (5.0.2), strictly confined Microk8s (v1.27.4) and juju (3.2.0). The controller is running in a LXD container and after slight tinkering* I was able to add microk8s cloud to the controller. I'm able to add models and deploy applications that (I assume) don't require persistent storage like "catalogue"[0]. "modeloperator" pod also starts up correctly. However deployment of apps like "prometheus-k8s"[1] fail with following error in juju logs

controller-0: 13:42:41 ERROR juju.worker.caasapplicationprovisioner.runner exited "prometheus": ensuring application "prometheus": StorageClass.storage.k8s.io "monitoring-" is invalid: [metadata.name: Invalid value: "monitoring-": a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*'), provisioner: Required value]
controller-0: 13:42:41 INFO juju.worker.caasapplicationprovisioner.runner restarting "prometheus" in 3s

It appears to me that juju fails to properly compose name when requesting storage? The "monitoring" name mentioned in the above logs is the name of the juju model.

*Steps to reproduce:

  * Bootstrap Juju controller into LXD container
  * Install strictly confined microk8s (--channel 1.27-strict/stable)
  * Manually add credentials to microk8s cloud via "juju add-credential microk8s"
    * type should be "oauth2" and token value can be found in output of "microk8s.config" command
  * Edit client config in /var/snap/microk8s/current/credentials/client.config . Change clusters.cluster.server value to point to the main host's IP, rather than localhost
  * Add cloud to the controller via "juju add-cloud -c <controller_name> microk8s"
  * Add model and deploy both "catalogue"[0] and "prometheus-k8s"[1] charms

Result should be that catalogue gets deployed but prometheus gets into error state with above log messages in "juju debug-log" output.

[0] https://charmhub.io/catalogue-k8s
[1] https://charmhub.io/prometheus-k8s

summary: - Controller running in LXD fails to deploy workloads in Microk8s cloud. .
+ Controller running in LXD fails to deploy workloads in Microk8s cloud.
Invalid storage name
Changed in juju:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Yang Kelvin Liu (kelvin.liu)
Revision history for this message
Babak K. Shandiz (babakks) wrote :

I'm having the same problem. Could you please have a look at it?
https://bugs.launchpad.net/juju/+bug/2077426

Revision history for this message
Ian Booth (wallyworld) wrote :

It seems like the cluster might now have a default storage class.

Can you try setting up a storage class and informing juju to use it by setting the "workload-storage" model config attribute.

If the above fixes it, the error messaging out of Juju needs to be improved.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.