Kubernetes-core and Add-k8s


I deployed a kubernetes-core with juju on a openstack. Now on a other machine I want to juju add-k8s and bootstrap it. But in the bootstrap process seems to fail with the following error:

ERROR failed to bootstrap model: creating controller stack for controller: creating service for controller: attempt count exceeded: controller service address not provisioned

It seems like the controller is created on kubernetes because juju (even on another machine) doesn’t let me create a controller with the same name

I deployed the following kubernetes-core bundle: https://jaas.ai/kubernetes-core

And executed the following add-k8s command:

juju add-k8s --region=hayward/RegionOne --storage=local-storage < .kube/config

the local-storage class I created manually and the .kube/config I copied from the cluster to that machine.


Can you run through the commands you ran on the second client please? I think there’s a mix up in the add-k8s (add the cloud) vs juju bootstrap but want to make sure we follow what you’re saying.


On the one where I deployed kubernetes-core I ran these commands:

juju add-cloud
juju add-credentials hayward
juju deploy ./bundle.yaml // The kubernetes-core bundle


No sorry, I meant on the one where you were trying to deploy workloads into your new kubernetes.

So I assume on there you did the add-k8s command and then you ran a bootstrap command?

I would expect you’d do something like

juju add-k8s myk8scluster --storage=local-storage
juju bootstrap myk8scluster

I’m not sure what “cloud” hayward is? Is that the OpenStack? Is that OpenStack known on the client you want to create the model on top of k8s with?


Yes, hayward is the openstack on which the kubernetes was deployed. I also added it with the juju add-cloud command, so when I execute juju list-clouds it shows up.

The bootstrap command was just as you stated:
juju bootstrap juju-cluster k8s


Ok, so having the “region” of the k8s be based on the openstack isn’t quite right. To the client bootstraping to k8s it shouldn’t need to worry about that I don’t think. add-k8s will find the .kube/config I believe so I’m curious if the command I put up there works for you?


that might need to be

juju add-k8s --local ...


I have been always piping the .kube/config to the add-k8s command just in case.

If I try just with --local without region I get an error telling me to provide the --region.

I also tried --local and --region together and I get the same result as in the beginning. It starts bootstraping, it gets stuck in the " Creating k8s resources for controller " phase and times out with the Error of the first post of this thread.


Supplying a region with juju add-k8s was introduced in Juju 2.6 to allow Juju to perform necessary checks for recommended storage and other housekeeping things. Unfortunately, this was done as a mandatory argument and so doesn’t work with clouds where region may not be configured.

The soon to be released Juju 2.6.3 (any day now) will have a fix for this issue - region will be optional for clouds such as Openstack.


Hi Ian,

I just tried it out with the new Juju 2.6.3 release and I still get the same error. I added the recommended Cinder storage that one of the error messages tells me to, just in case, but the error continues to be the following:

ubuntu@osm-kuber:~$ juju bootstrap juju-cluster
Creating Juju controller "juju-cluster" on juju-cluster
Creating k8s resources for controller "controller-juju-cluster"
ERROR failed to bootstrap model: creating controller stack for controller: creating service for controller: attempt count exceeded: controller service address not provisioned

Are there some additional requirements that my Kubernetes install may need for it to work? I know in microk8s I need to enable storage and dns. But I think this stuff should be enabled in a standard kubernetes-core install right?


A standard kubernetes-core install will not set up any k8s storage class on the cluster; that’s usually done via deploying the cloud specific (openstack in this case) integrator charm and relating to the master/worker charms.

Can you confirm that your cluster has a StorageClass set up and annotated as cluster default storage? Also, what’s in the config block when you juju show-cloud <yourk8scluster>? When you bootstrap, is there a PVC created in the cluster? If so, what does kubectl say about its status? Can you try bootstrapping with --debug to get some extra output?


I reinstalled the kubernetes-core following the instruction posted in the link you sent me:

juju deploy cs:canonical-kubernetes --overlay ./k8s-openstack-overlay.yaml
juju trust openstack-integrator

Afterwards I connected kubectl to the k8s by copying the config file in kubernetes-master to ~/.kube/config.
Then I executed the script in the section"Creating a pod with a PersistentDisk-backed volume" of the examples that are in your provided link.
The created storage class was also set to default so I got the following result:

ubuntu@kuber:~$ kubectl get storageclasses
NAME                           PROVISIONER            AGE
openstack-standard (default)   kubernetes.io/cinder   34m

Done this, I executed the following command:

cat .kube/config | juju add-k8s --cloud=hayward juju-cluster --storage=openstack-standard

‘hayward’ is the openstack cloud where the kubernetes-core was deployed. This is the result of the show-cloud command:

ubuntu@kuber:~$ juju show-cloud juju-cluster
defined: public
type: k8s
description: ""
auth-types: [userpass]
  "": {}
- |-

Finally I executed juju bootstrap juju-cluster --debug and got the same error as before.

Here is the complete output of the bootstrap command: https://paste.ubuntu.com/p/FKX5XZd4qx/


For those following along, it appears that the k8s service created for the Juju controller is not getting an externally accessible IP address assigned to it. We need to dig into the reason why.


@dominik.f can you provide the ‘juju model-config’ output for the model in which k8s is deployed please?