Error when running k8s gitlab charm from the store

I have deployed Charmed k8s using MAAS to a whole bunch of VMs.

I was curious about the gitlab k8s charm in the store and tried it out and got the following error.

What does the error below mean? I am currently in the model ‘charmed’, my model for Charmed k8s with some additions for monitoring.

dw@maas-effect:~$ juju deploy cs:~juju/gitlab-k8s-1
ERROR series "kubernetes" in a non container model not valid

That error message is trying to tell you that the model isn’t deploying to Kubernetes. Once you’ve deployed Charmed k8s, you need to then run juju add-k8s to register it with the controller. You can then create a k8s model

The model you are deploying to is the model for managing the k8s cluster itself, not workloads in the cluster. ie the underlying cloud is MAAS, and charmed k8s is itself a workload deployed to that MAAS cloud.

What you need to do is use the add-k8s command to create a new “cloud” in the controller representing the k8s cluster. You’ll need to ensure you’ve created a default Storage Class and then, assuming your kubeconfig is in the standard place, juju add-k8s myk8s. Or you can pipe kubeconfig to add-k8s: cat kubeconfig | juju add-k8s myk8s. See juju help add-k8s for more examples.

Once the k8s cluster is registered with the controller, you can then add a model to it and deploy your k8s charms to that new k8s model. For gitlab, you’ll also need to deploy the mariadb charm and relate it so gitlab has a suitable backend.

See Getting Started
It talks about CK deployed to AWS, but it’s a similar concept when using MAAS.

Good to know! I did not know why I had no option to do that in the gui as well. Something seemed up.

It won’t let me do that without specifying --storage=<somestorageclass> and I haven’t figured out how to add storage solely with juju yet.

I am trying to avoid what I usually do with a non-Juju cluster, which is apply the manifests from rook.io for ceph.

But I got stuck following these directions:

And posted here:

Once I have storage configured looks like I can add-k8s and install the k8s charms.

Thanks!

If you have a Storage Class which has been set up as the default for the cluster, the --storage option should not be needed. Hopefully you’re using Juju 2.7.1.

Maybe @tvansteenburgh can help with the k8s storage class set up with CK and MAAS?

I added the storage to K8s the regular way I do it without Juju by just using kubectl and rook (rook.io). I am now able to add the k8s substrate it seems and things are humming along. It would have been ideal to use Juju to set up the storage, though.

image

I’ll ping the charmed k8s guys again and see if they can help sort out the maas/ck storage setup.

The first attempt to bootstrap was unsuccessful:

I have tried multiple times now and it always times out during bootstrap :frowning:

One thing to check is that the client from which you bootstrap has connectivity to the machine which has been started to run the Juju controller. The client needs to be ave to connect to port 17070.

If all looks ok on that front, you can run bootstrap with --keep-broken and Juju will keep the instance running even after bootstrap fails. Then you can ssh in and inspect thing like the cloud-init log to see if there’s any errors which would point to reasons why the Juju agent might not be run.

I deployed using Canal for my CNI instead of Flannel and everything just worked… Gitlab is deploying now with MariaDB.