Juju add-k8s failing with Minikube

Bug #1905321 reported by Kenneth Koski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Thomas Miller

Bug Description

I am attempting to bootstrap Juju onto a freshly-installed Minikube instance. Minikube has set up `~/.kube/config` correctly, and I can talk to it just fine with `kubectl` commands. However, I get this message when I attempt to run `juju add-k8s`:

ERROR ensuring k8s credential "283394d5" with RBAC setup: invalid configuration: certificate-authority-data and certificate-authority are both specified for minikube. certificate-authority-data will override.

The --debug flag doesn't add much more info:

18:59:25 INFO juju.cmd supercommand.go:54 running juju [2.8.6 0 5d0442d3e15952bfc0ce059cb43ef7949ca71aaa gc go1.14.10]
18:59:25 DEBUG juju.cmd supercommand.go:55 args: []string{"/snap/juju/14498/bin/juju", "add-k8s", "mk", "--debug"}
18:59:25 INFO juju.util.exec exec.go:209 run result: exit status 1
18:59:25 DEBUG juju.kubernetes.provider detectcloud.go:24 failed to query local microk8s: microk8s is not installed: microk8s not found
18:59:25 DEBUG juju.caas.kubernetes.clientconfig k8s.go:280 The kubeconfig file path: "/home/ubuntu/.kube/config"
18:59:25 DEBUG juju.caas.kubernetes.clientconfig k8s.go:76 no cluster name specified, so use current context "minikube"
ERROR ensuring k8s credential "688e4b23" with RBAC setup: invalid configuration: certificate-authority-data and certificate-authority are both specified for minikube. certificate-authority-data will override.
18:59:25 DEBUG cmd supercommand.go:537 error stack:
invalid configuration: certificate-authority-data and certificate-authority are both specified for minikube. certificate-authority-data will override.
/build/snapcraft-juju-35d6cf/parts/juju/src/caas/kubernetes/clientconfig/plugins.go:50:
/build/snapcraft-juju-35d6cf/parts/juju/src/caas/kubernetes/clientconfig/k8s.go:31:
/build/snapcraft-juju-35d6cf/parts/juju/src/caas/kubernetes/clientconfig/k8s.go:97: ensuring k8s credential "688e4b23" with RBAC setup
/build/snapcraft-juju-35d6cf/parts/juju/src/caas/kubernetes/provider/cloud.go:79:
/build/snapcraft-juju-35d6cf/parts/juju/src/cmd/juju/caas/add.go:498:

Here is the generated kubeconfig file:

apiVersion: v1
clusters:
- cluster:
    certificate-authority: /home/ubuntu/.minikube/ca.crt
    server: https://192.168.49.2:8443
  name: minikube
contexts:
- context:
    cluster: minikube
    namespace: default
    user: minikube
  name: minikube
current-context: minikube
kind: Config
preferences: {}
users:
- name: minikube
  user:
    client-certificate: /home/ubuntu/.minikube/profiles/minikube/client.crt
    client-key: /home/ubuntu/.minikube/profiles/minikube/client.key

Revision history for this message
Kenneth Koski (knkski) wrote :

It seems that this bug is actually that Juju doesn't handle `certificate-authority` well, as if I edit `~/.kube/config` to convert `certificate-authority` to the `certificate-authority-data` option and inline the contents of `/home/ubuntu/.minikube/ca.crt`, it works fine.

Revision history for this message
John A Meinel (jameinel) wrote :

It would appear that we think there is a certificate-authority-data even though it doesn't seem to be set in the file.

Thomas Miller (tlmiller)
Changed in juju:
assignee: nobody → Thomas Miller (tlmiller)
Thomas Miller (tlmiller)
Changed in juju:
status: New → In Progress
Revision history for this message
Thomas Miller (tlmiller) wrote :
Ian Booth (wallyworld)
Changed in juju:
milestone: none → 2.8.7
importance: Undecided → High
Ian Booth (wallyworld)
Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.