How do I use my own installed k8s cluster in juju clouds??

In this article Juju | Get started with Juju says how to use microk8s in juju cloud

ubuntu@tutorial-vm:~$ juju clouds

microk8s 1 localhost k8s 1 built-in A Kubernetes Cluster has a built-in k8s cloud

But I install juju 3.3.1 , and juju clouds command output :

kubernetes-admin@kubernetes 0 k8s 0 built-in A local Kubernetes context

localhost 1 localhost lxd 0 built-in LXD Container Hypervisor

I want to use cloud name is kubernetes-admin@kubernetes and type is k8s built-in cloud How can init region for kubernetes-admin@kubernetes?? After init regions , I can bootstrap juu controller.

‘juju clouds --format yaml’ command output below, That means it’s already recognized

Only clouds with registered credentials are shown.

There are more clouds, use --all to see them.


defined: built-in

type: k8s

description: A local Kubernetes context

auth-types: [certificate, clientcertificate, oauth2, oauth2withcert, userpass]

endpoint: https://node100:6443


  • |



    -----END CERTIFICATE-----


defined: built-in

type: lxd

description: LXD Container Hypervisor

auth-types: [certificate]


localhost: {}
aik8s@ai-k8s-node100:~$ juju bootstrap kubernetes-admin@kubernetes aik8s-controller
ERROR cloud name "kubernetes-admin@kubernetes" not valid

A cloud name cannot have ‘@’ in it. Which is bad UX as the juju clouds command is picking up the cloud automagically. Please file a juju bug on this issue.

To work around it, use juju add-cloud to define your local Kubernetes cluster and define a name for the cloud which starts with an alpha-numeric character and uses alpha-numeric , dash, and underscore characters to follow.

Which subcommand should use?? add-cloud or add-k8s ? background: I have three VMware virtual machines installed ubuntu 22.04.1 LTS. and I install k8s on these three machines(one control-plane and two workers). Then I install juju. I want to juju can manage these three machines . Then I can bootstrap controller and add model and deploy mode with juju.

Use juju add-k8s. I also recommend the following flags: --cluster-name, --cloud , maybe more depending on your config.