Juju and microk8s charm

Hi All,

I am new to JuJu and trying to understand the need for microk8s charm. As per my understanding JuJu orchestrates applications in a cloud like k8, aws and so on. Now if we are using JuJu to orchestrate microk8s charm as an application will it be considered as a cloud under the same juju instance ?

https://charmhub.io/microk8s/docs/how-to-cluster

Earlier i was first installing microk8s via snap and then juju bootstrap to the microk8s cloud. Now if I am using juju deploy to setup microk8s charm do i still need to bootstrap the same as cloud. What will be the usecase for the same ?

Hi! Indeed it is my understanding that if you use juju to deploy a k8s cloud (of any type), you’ll need to bootstrap a new controller onto that cloud before you can manage it with juju. Juju doesn’t see what workload a charm is deploying/operating.

Thanks for the reply @ppasotti

Ideally the flow would be juju bootstrap, juju add model and then juju deploy. So in the case of microk8s charm, will it be juju deploy and then juju bootstrap? If yes, in which cloud is the application (in this case microk8s) is deployed ?

well before you can juju deploy anything, you need to have a controller bootstrapped. the microk8s charm is intended for situations where you already have a cloud bootstrapped.

if you don’t have a cloud yet, you can get one by running for example the microk8s snap on the host. Then you can deploy anything you like on top of that microk8s, even, I guess, another microk8s :slight_smile:

Thanks for the reply @ppasotti

Well in that case I can use microk8s charms only on top of machine cloud bootstrapped to juju.

One more addon question, sorry for including the same here

Currently I install microk8s via snap and initiate juju bootstrap to trigger bootstrapping controller with microk8s. Once done, I perform juju deploy kubeflow on the microk8s cloud.

If I am using say AWS cloud and triggering juju deploy for microk8s charm on it. Can i deploy kubeflow charm on top of microk8s charm? As per my understanding No, can you confirm the same?

Ok so if I understand correctly, you have an AWS machine cloud. You bootstrap juju on top of that, then you juju deploy microk8s.

Now you need to bootstrap juju on top of the microk8s, and juju-deploy kubeflow on the microk8s cloud. That sounds reasonable to me, I don’t see why it shouldn’t work. Let me see if I can find you someone more kubeflow-wise than I am to confirm.

Hey @codingfreak!

I remember having these same questions :smiley: It all feels a bit like inception at first…

Recapping what you and @ppasotti were saying, essentially you can juju bootstrap onto both clouds (like AWS) and any Kubernetes, and once you’ve done that you can juju deploy things onto that. So something like this is a possible workflow (typing from memory, so might have a little syntax wrong):

juju bootstrap aws my-aws
juju deploy microk8s  # (to my-aws controller)
juju bootstrap microk8s my-microk8s  # (I'm missing some syntax here.  I think you might need to add microk8s as a cloud first?)
juju deploy kubeflow -c my-microk8s  # (to the my-microk8s controller)

After all that, you’d have:

  • a juju controller on AWS VMs
  • a microk8s deployed to that juju controller
  • another juju controller deployed to microk8s
  • kubeflow deployed on the second controller in microk8s

Having said all this, I think the microk8s charm is not the preferred way to deploy microk8s (iiuc it will be deprecated and is not fully supported). So there might be a more effective way of getting to the end point you want. But the approach is technically valid

Is your end goal having Kubeflow running on AWS? Maybe I can suggest a simpler approach based on your goals

Thanks for the reply @ca-scribner and @ppasotti

Well I am not planning to deploy anything on AWS as I prefer to deploy on local cloud.

The reason I brought up the below example is to understand if I am using charmed-microk8s, can I deploy charmed kubeflow on top of it. I understand it gives a feeling of inception and sometimes a level confusion though.

"If I am using say AWS cloud and triggering juju deploy for microk8s charm on it. Can i deploy kubeflow charm on top of microk8s charm? "

As I stated earlier, my deployment looks as shown below

  1. Install microk8s snap
  2. Juju bootstrap to microk8s cloud
  3. Juju deploy kubeflow charm on microk8s cloud

If there is any other approach to deploy the same please do share the details which I can try out.

sorry for the slow response, I was out last week.

Your procedure looks like the optimal one to me. That’s exactly what I do during development too