Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

registry-creds addon: error converting YAML to JSON: yaml: line 20: did not find expected key ] #9722

Closed
jim-barber-he opened this issue Nov 17, 2020 · 9 comments · Fixed by #9733
Assignees
Labels
addon/registry-creds registry-creds issues kind/support Categorizes issue or PR as a support question.

Comments

@jim-barber-he
Copy link

Steps to reproduce the issue:

I'm using hypervisor=none and Kubernetes 1.17.x
The following commands work for minikube 1.14.2, but are broken in version 1.15.0 and 1.15.1 when it comes time to enable the registry-creds addon.

Minikube is started like so:

minikube delete
rm -rf ~/.minikube
sudo minikube start --driver=none --kubernetes-version v1.17.9
sudo chown -R $(id -u):$(id -g) ~/.minikube ~/.kube

Then the registry-creds is run like so:

sudo minikube addons enable registry-creds

Full output of failed command:

$ sudo minikube addons enable registry-creds

❌  Exiting due to MK_ENABLE: run callbacks: running callbacks: [sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
]

😿  If the above advice does not help, please let us know: 
👉  https://github.com/kubernetes/minikube/issues/new/choose

Full output with --alsologtostderr follows:

$ sudo minikube --alsologtostderr addons enable registry-creds
I1117 12:39:22.443312     599 out.go:185] Setting OutFile to fd 1 ...
I1117 12:39:22.443538     599 out.go:237] isatty.IsTerminal(1) = true
I1117 12:39:22.443552     599 out.go:198] Setting ErrFile to fd 2...
I1117 12:39:22.443566     599 out.go:237] isatty.IsTerminal(2) = true
I1117 12:39:22.443680     599 root.go:279] Updating PATH: /home/jim/.minikube/bin
W1117 12:39:22.443829     599 root.go:254] Error reading config file at /home/jim/.minikube/config/config.json: open /home/jim/.minikube/config/config.json: no such file or directory
I1117 12:39:22.444423     599 addons.go:55] Setting registry-creds=true in profile "minikube"
I1117 12:39:22.444446     599 addons.go:131] Setting addon registry-creds=true in "minikube"
I1117 12:39:22.444465     599 host.go:66] Checking if "minikube" exists ...
I1117 12:39:22.444826     599 exec_runner.go:49] Run: systemctl --version
I1117 12:39:22.449518     599 kubeconfig.go:93] found "minikube" server: "https://10.1.1.64:8443"
I1117 12:39:22.449552     599 api_server.go:146] Checking apiserver status ...
I1117 12:39:22.449599     599 exec_runner.go:49] Run: sudo pgrep -xnf kube-apiserver.*minikube.*
I1117 12:39:22.465506     599 exec_runner.go:49] Run: sudo egrep ^[0-9]+:freezer: /proc/30228/cgroup
I1117 12:39:22.474428     599 api_server.go:162] apiserver freezer: "9:freezer:/kubepods/burstable/pod96650ea427e42d1ae97c5036d1c0aae1/cc5380129c570ffe4d9985504f9df116ed71744365d41266e0931195292f602d"
I1117 12:39:22.474517     599 exec_runner.go:49] Run: sudo cat /sys/fs/cgroup/freezer/kubepods/burstable/pod96650ea427e42d1ae97c5036d1c0aae1/cc5380129c570ffe4d9985504f9df116ed71744365d41266e0931195292f602d/freezer.state
I1117 12:39:22.482426     599 api_server.go:184] freezer state: "THAWED"
I1117 12:39:22.482474     599 api_server.go:221] Checking apiserver healthz at https://10.1.1.64:8443/healthz ...
I1117 12:39:22.491255     599 api_server.go:241] https://10.1.1.64:8443/healthz returned 200:
ok
I1117 12:39:22.491281     599 addons.go:243] installing /etc/kubernetes/addons/registry-creds-rc.yaml
I1117 12:39:22.491300     599 exec_runner.go:91] found /etc/kubernetes/addons/registry-creds-rc.yaml, removing ...
I1117 12:39:22.491372     599 exec_runner.go:98] cp: deploy/addons/registry-creds/registry-creds-rc.yaml.tmpl --> /etc/kubernetes/addons/registry-creds-rc.yaml (3249 bytes)
I1117 12:39:22.491480     599 exec_runner.go:49] Run: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml
W1117 12:39:22.608246     599 addons.go:264] apply failed, will retry: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:39:22.608283     599 retry.go:31] will retry after 276.165072ms: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:39:22.884680     599 exec_runner.go:49] Run: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml
W1117 12:39:23.010588     599 addons.go:264] apply failed, will retry: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:39:23.010658     599 retry.go:31] will retry after 540.190908ms: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:39:23.551100     599 exec_runner.go:49] Run: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml
W1117 12:39:23.669202     599 addons.go:264] apply failed, will retry: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:39:23.669243     599 retry.go:31] will retry after 655.06503ms: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:39:24.324552     599 exec_runner.go:49] Run: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml
W1117 12:39:24.450904     599 addons.go:264] apply failed, will retry: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:39:24.450938     599 retry.go:31] will retry after 791.196345ms: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:39:25.242362     599 exec_runner.go:49] Run: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml
W1117 12:39:25.358415     599 addons.go:264] apply failed, will retry: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:39:25.358454     599 retry.go:31] will retry after 1.170244332s: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:39:26.528942     599 exec_runner.go:49] Run: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml
W1117 12:39:26.656228     599 addons.go:264] apply failed, will retry: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:39:26.656255     599 retry.go:31] will retry after 2.253109428s: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:39:28.909642     599 exec_runner.go:49] Run: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml
W1117 12:39:29.033072     599 addons.go:264] apply failed, will retry: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:39:29.033099     599 retry.go:31] will retry after 1.610739793s: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:39:30.644113     599 exec_runner.go:49] Run: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml
W1117 12:39:30.763244     599 addons.go:264] apply failed, will retry: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:39:30.763277     599 retry.go:31] will retry after 2.804311738s: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:39:33.567779     599 exec_runner.go:49] Run: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml
W1117 12:39:33.681845     599 addons.go:264] apply failed, will retry: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:39:33.681883     599 retry.go:31] will retry after 3.824918958s: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:39:37.507045     599 exec_runner.go:49] Run: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml
W1117 12:39:37.627336     599 addons.go:264] apply failed, will retry: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:39:37.627362     599 retry.go:31] will retry after 7.69743562s: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:39:45.325039     599 exec_runner.go:49] Run: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml
W1117 12:39:45.442573     599 addons.go:264] apply failed, will retry: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:39:45.442601     599 retry.go:31] will retry after 14.635568968s: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:40:00.078386     599 exec_runner.go:49] Run: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml
W1117 12:40:00.214694     599 addons.go:264] apply failed, will retry: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:40:00.214719     599 retry.go:31] will retry after 28.406662371s: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:40:28.621691     599 exec_runner.go:49] Run: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml
W1117 12:40:28.731988     599 addons.go:264] apply failed, will retry: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:40:28.732021     599 retry.go:31] will retry after 23.168280436s: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:40:51.900539     599 exec_runner.go:49] Run: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml
W1117 12:40:52.033870     599 addons.go:264] apply failed, will retry: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:40:52.033906     599 retry.go:31] will retry after 42.848266963s: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:41:34.882446     599 exec_runner.go:49] Run: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml
W1117 12:41:34.999201     599 addons.go:264] apply failed, will retry: sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
I1117 12:41:35.001545     599 out.go:110] 

W1117 12:41:35.001701     599 out.go:146] ❌  Exiting due to MK_ENABLE: run callbacks: running callbacks: [sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
]
❌  Exiting due to MK_ENABLE: run callbacks: running callbacks: [sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.17.9/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
]
W1117 12:41:35.001764     599 out.go:146] 

W1117 12:41:35.001809     599 out.go:146] 😿  If the above advice does not help, please let us know: 
😿  If the above advice does not help, please let us know: 
W1117 12:41:35.001882     599 out.go:146] 👉  https://github.com/kubernetes/minikube/issues/new/choose
👉  https://github.com/kubernetes/minikube/issues/new/choose
I1117 12:41:35.003420     599 out.go:110] 

Full output of minikube start command used, if not already included:

$ sudo minikube start --driver=none --kubernetes-version v1.17.9
😄  minikube v1.15.1 on Debian 10.6
✨  Using the none driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
🤹  Running on localhost (CPUs=8, Memory=15995MB, Disk=230659MB) ...
ℹ️  OS release is Debian GNU/Linux 10 (buster)
🐳  Preparing Kubernetes v1.17.9 on Docker 19.03.13 ...
    > kubectl.sha256: 65 B / 65 B [--------------------------] 100.00% ? p/s 0s
    > kubelet.sha256: 65 B / 65 B [--------------------------] 100.00% ? p/s 0s
    > kubeadm.sha256: 65 B / 65 B [--------------------------] 100.00% ? p/s 0s
    > kubeadm: 37.53 MiB / 37.53 MiB [---------------] 100.00% 1.93 MiB p/s 19s
    > kubectl: 41.49 MiB / 41.49 MiB [---------------] 100.00% 1.92 MiB p/s 22s
    > kubelet: 106.51 MiB / 106.51 MiB [-------------] 100.00% 3.53 MiB p/s 30s
🤹  Configuring local host environment ...

❗  The 'none' driver is designed for experts who need to integrate with an existing VM
💡  Most users should use the newer 'docker' driver instead, which does not require root!
📘  For more information, see: https://minikube.sigs.k8s.io/docs/reference/drivers/none/

❗  kubectl and minikube configuration will be stored in /home/jim
❗  To use kubectl or minikube commands as your own user, you may need to relocate them. For example, to overwrite your own settings, run:

    ▪ sudo mv /home/jim/.kube /home/jim/.minikube $HOME
    ▪ sudo chown -R $USER $HOME/.kube $HOME/.minikube

💡  This can also be done automatically by setting the env var CHANGE_MINIKUBE_NONE_USER=true
🔎  Verifying Kubernetes components...
🌟  Enabled addons: storage-provisioner, default-storageclass

❗  /usr/local/bin/kubectl is version 1.19.4, which may have incompatibilites with Kubernetes 1.17.9.
    ▪ Want kubectl v1.17.9? Try 'minikube kubectl -- get pods -A'
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default

Also the content of the /etc/kubernetes/addons/registry-creds-rc.yaml file that it is complaining about is as follows:

$ sudo cat /etc/kubernetes/addons/registry-creds-rc.yaml 
apiVersion: apps/v1
kind: Deployment
metadata:
  name: registry-creds
  namespace: kube-system
  labels:
    addonmanager.kubernetes.io/mode: Reconcile
    kubernetes.io/minikube-addons: registry-creds
spec:
  replicas: 1
  selector:
    matchLabels:
        name: registry-creds
  template:
    metadata:
      labels:
        name: registry-creds
        addonmanager.kubernetes.io/mode: Reconcile
    spec:
      containers:
      - image: {{default "upmcenterprises" .ImageRepository}}/registry-creds:1.10
        name: registry-creds
        imagePullPolicy: Always
        env:
          - name: AWS_ACCESS_KEY_ID
            valueFrom:
              secretKeyRef:
                name: registry-creds-ecr
                key: AWS_ACCESS_KEY_ID
          - name: AWS_SECRET_ACCESS_KEY
            valueFrom:
              secretKeyRef:
                name: registry-creds-ecr
                key: AWS_SECRET_ACCESS_KEY
          - name: AWS_SESSION_TOKEN
            valueFrom:
              secretKeyRef:
                name: registry-creds-ecr
                key: AWS_SESSION_TOKEN
          - name: awsregion
            valueFrom:
              secretKeyRef:
                name: registry-creds-ecr
                key: aws-region
          - name: awsaccount
            valueFrom:
              secretKeyRef:
                name: registry-creds-ecr
                key: aws-account
          - name: aws_assume_role
            valueFrom:
              secretKeyRef:
                name: registry-creds-ecr
                key: aws-assume-role
          - name: awsregion
            valueFrom:
              secretKeyRef:
                name: registry-creds-ecr
                key: aws-region
          - name: DOCKER_PRIVATE_REGISTRY_PASSWORD
            valueFrom:
              secretKeyRef:
                name: registry-creds-dpr
                key: DOCKER_PRIVATE_REGISTRY_PASSWORD
          - name: DOCKER_PRIVATE_REGISTRY_SERVER
            valueFrom:
              secretKeyRef:
                name: registry-creds-dpr
                key: DOCKER_PRIVATE_REGISTRY_SERVER
          - name: DOCKER_PRIVATE_REGISTRY_USER
            valueFrom:
              secretKeyRef:
                name: registry-creds-dpr
                key: DOCKER_PRIVATE_REGISTRY_USER
          - name: gcrurl
            valueFrom:
              secretKeyRef:
                name: registry-creds-gcr
                key: gcrurl
          - name: ACR_PASSWORD
            valueFrom:
              secretKeyRef:
                name: registry-creds-acr
                key: ACR_PASSWORD
          - name: ACR_URL
            valueFrom:
              secretKeyRef:
                name: registry-creds-acr
                key: ACR_URL
          - name: ACR_CLIENT_ID
            valueFrom:
              secretKeyRef:
                name: registry-creds-acr
                key: ACR_CLIENT_ID
        volumeMounts:
        - name: gcr-creds
          mountPath: "/root/.config/gcloud"
          readOnly: true
      volumes:
      - name: gcr-creds
        secret:
          secretName: registry-creds-gcr
          items:
            - key: "application_default_credentials.json"
              path: "application_default_credentials.json"
@jim-barber-he
Copy link
Author

This also happens if I let it use the default version of Kubernetes v1.19.4

$ sudo minikube delete
🔄  Uninstalling Kubernetes v1.18.12 using kubeadm ...
🔥  Deleting "minikube" in none ...
💀  Removed all traces of the "minikube" cluster.
$ sudo rm -rf ~/.minikube/
$ sudo minikube start --driver=none
😄  minikube v1.15.1 on Debian 10.6
✨  Using the none driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
🤹  Running on localhost (CPUs=8, Memory=15995MB, Disk=230659MB) ...
ℹ️  OS release is Debian GNU/Linux 10 (buster)
🐳  Preparing Kubernetes v1.19.4 on Docker 19.03.13 ...
    > kubelet.sha256: 64 B / 64 B [--------------------------] 100.00% ? p/s 0s
    > kubectl.sha256: 64 B / 64 B [--------------------------] 100.00% ? p/s 0s
    > kubeadm.sha256: 64 B / 64 B [--------------------------] 100.00% ? p/s 0s
    > kubectl: 41.01 MiB / 41.01 MiB [---------------] 100.00% 3.74 MiB p/s 11s
    > kubeadm: 37.30 MiB / 37.30 MiB [---------------] 100.00% 1.82 MiB p/s 20s
    > kubelet: 104.92 MiB / 104.92 MiB [-------------] 100.00% 3.47 MiB p/s 30s
🤹  Configuring local host environment ...

❗  The 'none' driver is designed for experts who need to integrate with an existing VM
💡  Most users should use the newer 'docker' driver instead, which does not require root!
📘  For more information, see: https://minikube.sigs.k8s.io/docs/reference/drivers/none/

❗  kubectl and minikube configuration will be stored in /home/jim
❗  To use kubectl or minikube commands as your own user, you may need to relocate them. For example, to overwrite your own settings, run:

    ▪ sudo mv /home/jim/.kube /home/jim/.minikube $HOME
    ▪ sudo chown -R $USER $HOME/.kube $HOME/.minikube

💡  This can also be done automatically by setting the env var CHANGE_MINIKUBE_NONE_USER=true
🔎  Verifying Kubernetes components...
🌟  Enabled addons: storage-provisioner, default-storageclass
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
$ sudo minikube addons enable registry-creds

❌  Exiting due to MK_ENABLE: run callbacks: running callbacks: [sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.19.4/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: exit status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
]

😿  If the above advice does not help, please let us know: 
👉  https://github.com/kubernetes/minikube/issues/new/choose

@jim-barber-he
Copy link
Author

And it is also happening when I use the docker driver instead of the none driver.

$ sudo minikube delete
🔄  Uninstalling Kubernetes v1.19.4 using kubeadm ...
🔥  Deleting "minikube" in none ...
💀  Removed all traces of the "minikube" cluster.
$ sudo rm -rf ~/.minikube/
$ minikube start --driver=docker
😄  minikube v1.15.1 on Debian 10.6
✨  Using the docker driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
🚜  Pulling base image ...
💾  Downloading Kubernetes v1.19.4 preload ...
    > preloaded-images-k8s-v6-v1.19.4-docker-overlay2-amd64.tar.lz4: 486.35 MiB
🔥  Creating docker container (CPUs=2, Memory=3900MB) ...
🐳  Preparing Kubernetes v1.19.4 on Docker 19.03.13 ...
🔎  Verifying Kubernetes components...
🌟  Enabled addons: storage-provisioner, default-storageclass
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
$ minikube addons enable registry-creds

❌  Exiting due to MK_ENABLE: run callbacks: running callbacks: [sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.19.4/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: Process exited with status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
]

😿  If the above advice does not help, please let us know: 
👉  https://github.com/kubernetes/minikube/issues/new/choose

@k8s-ci-robot k8s-ci-robot added the kind/support Categorizes issue or PR as a support question. label Nov 17, 2020
@RA489
Copy link

RA489 commented Nov 17, 2020

/kind support

@fredrik-smedberg
Copy link

This solves the issue #9725

@fredrik-smedberg
Copy link

fredrik-smedberg commented Nov 17, 2020

Temporary work-around until this is fixed and released upstream

Enter the minikube Docker:
minikube ssh
and inside the Kubernetes environment, edit /etc/kubernetes/addons/registry-creds-rc.yaml on line 21.
For example using vim (or any editor of your choice):
sudo vim /etc/kubernetes/addons/registry-creds-rc.yaml
so it writes:
- image: upmcenterprises/registry-creds:1.10

If your environment lacks vim, you can install it by:
sudo apt update
sudo apt install vim

After you've edited the file, run:
sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.19.4/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml
and if it was successful you'll see:
deployment.apps/registry-creds created
You can now exit the minikube environment with exit

Please note that even though registry-creds is now enabled, it won't show up if you type:
minikube addons list

However, you can confirm it running by:
kubectl get pods --namespace=kube-system

@alonyb
Copy link

alonyb commented Nov 18, 2020

/assign

@jpdoria
Copy link

jpdoria commented Nov 28, 2020

I also experienced the same issue just now.

❯ minikube start
😄  minikube v1.15.1 on Darwin 11.0.1
    ▪ KUBECONFIG=/Users/jp/.kube/fp/all.config:/Users/jp/.kube/config
✨  Automatically selected the docker driver. Other choices: hyperkit, virtualbox
👍  Starting control plane node minikube in cluster minikube
🔥  Creating docker container (CPUs=2, Memory=7913MB) ...
🐳  Preparing Kubernetes v1.19.4 on Docker 19.03.13 ...
🔎  Verifying Kubernetes components...
🌟  Enabled addons: storage-provisioner, default-storageclass
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
❯ minikube addons configure registry-creds

Do you want to enable AWS Elastic Container Registry? [y/n]: y
-- Enter AWS Access Key ID: REDACTED
-- Enter AWS Secret Access Key: REDACTED
-- (Optional) Enter AWS Session Token: minikube
-- Enter AWS Region: us-east-1
-- Enter 12 digit AWS Account ID (Comma separated list): REDACTED
-- (Optional) Enter ARN of AWS role to assume: REDACTED

Do you want to enable Google Container Registry? [y/n]: n

Do you want to enable Docker Registry? [y/n]: n

Do you want to enable Azure Container Registry? [y/n]: n
✅  registry-creds was successfully configured
❯ minikube addons enable registry-creds

❌  Exiting due to MK_ENABLE: run callbacks: running callbacks: [sudo KUBECONFIG=/var/lib/minikube/kubeconfig /var/lib/minikube/binaries/v1.19.4/kubectl apply -f /etc/kubernetes/addons/registry-creds-rc.yaml: Process exited with status 1
stdout:

stderr:
error: error parsing /etc/kubernetes/addons/registry-creds-rc.yaml: error converting YAML to JSON: yaml: line 20: did not find expected key
]

😿  If the above advice does not help, please let us know: 
👉  https://github.com/kubernetes/minikube/issues/new/choose

@josecsotomorales
Copy link

Getting this issue as well #9722 (comment)

@tstromberg tstromberg changed the title Cannot enable registry-creds addon registry-creds addon: error converting YAML to JSON: yaml: line 20: did not find expected key ] Dec 10, 2020
@tstromberg tstromberg added addon/registry-creds registry-creds issues and removed co/none-driver labels Dec 10, 2020
@tstromberg
Copy link
Contributor

tstromberg commented Dec 14, 2020

This is fixed at master, and will be part of the forthcoming v1.16.0 release (beta coming soon)

Alternatively, I believe you can use minikube v1.14.x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon/registry-creds registry-creds issues kind/support Categorizes issue or PR as a support question.
Projects
None yet
8 participants