I’m trying to get started with Juju managing Charms on Kubernetes. I am having trouble with
I’ve spun up a clean 20.04 LXD instance, installed the juju snap and the microk8s snap, and, as per the linked documentation:
If you have installed MicroK8s, the cluster is already registered. Feel free to move to the next section.
which is
To add a model, use the juju add-model command
When I do this, I get an error about lack of controllers:
# juju add-model loremipsum
ERROR No controllers registered.
Please either create a new controller using "juju bootstrap" or connect to
another controller that you have been given access to using "juju register".
and when I try to juju bootstrap, I get an empty error:
# juju bootstrap
Clouds
aws
aws-china
aws-gov
azure
azure-china
cloudsigma
google
joyent
localhost
microk8s
oracle
oracle-classic
rackspace
Select a cloud [localhost]: microk8s
Enter a name for the Controller [microk8s-localhost]:
ERROR
Am I doing something wrong or missing something here?
I believe that this might be related to the issue that @rick_h ran into yesterday. You may need to reboot the machine you created to get the ubuntu and root users to both be part of the microk8s group.
Hi @doismellburning, that sounds like a thorn in the docs. The page you’ve found assumes that you already have a controller available, which was necessary earlier in Juju’s life.
To bootstrap, you need to specify a cloud:
juju bootstrap microk8s <controller-name>
Could you please try the instructions on this page? They’re more recent than that one.
I’m not sure why - I don’t see evidence of this having recently changed for microk8s, and I couldn’t see anything obvious in juju --help bootstrap that I could use as a workaround
@doismellburning I assume “juju-microk8s” is the LXD container? You shouldn’t need to execute juju commands as root, fyi.
@wallyworld / @kelvin.liu - it looks like something may be broken with the microk8s integration. Is a nested use case, e.g. running microk8s inside LXD, supported?
I ran through the tutorial again yesterday on a fresh instance and hit the same context-free “ERROR”. Digging a bit more, it turned out one of the components of my microk8s install hadn’t come up properly. Once I ran through the steps at MicroK8s in LXD, I got a much healthier microk8s instance and Juju bootstrapped successfully!
There’s a couple of things here that I think would really help from my perspective please:
I recognise Juju isn’t responsible for checking the health of my Kubernetes cluster but it would help if it gave me more information than just “ERROR” - even a stack trace would give me something more concrete to google and dig into