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

kubectl <1.17 fails with error: type names don't match (Unknown, RawExtension) #10859

Closed
rajendar38 opened this issue Mar 17, 2021 · 14 comments
Closed
Labels
cmd/kubectl Issues with the "kubectl" command kind/support Categorizes issue or PR as a support question. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. long-term-support Long-term support issues that can't be fixed in code

Comments

@rajendar38
Copy link

Steps to reproduce the issue:

1.install latest version of minikube
I Installed into Ubuntu 18.04.3 LTS
amd64 / x86_64
Binary download
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube

  1. run kubectl config view
    get error :
    kubectl config view
    error: converting to : type names don't match (Unknown, RawExtension), and no conversion 'func (runtime.Unknown, runtime.RawExtension) error' registered.

Full output of failed command:

error: converting to : type names don't match (Unknown, RawExtension), and no conversion 'func (runtime.Unknown, runtime.RawExtension) error' registered.

Full output of minikube start command used, if not already included:
minikube start
😄 minikube v1.18.1 on Ubuntu 18.04
✨ Using the docker driver based on existing profile
👍 Starting control plane node minikube in cluster minikube
🔄 Restarting existing docker container for "minikube" ...
🐳 Preparing Kubernetes v1.20.2 on Docker 20.10.3 ...
🔎 Verifying Kubernetes components...
▪ Using image gcr.io/k8s-minikube/storage-provisioner:v4
▪ Using image kubernetesui/dashboard:v2.1.0
▪ Using image kubernetesui/metrics-scraper:v1.0.4
🌟 Enabled addons: storage-provisioner, default-storageclass, dashboard

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

Optional: Full output of minikube logs command:

@tejal29
Copy link
Contributor

tejal29 commented Mar 17, 2021

I am see this error too.

➜  skaffold git:(fix_container_str) ✗ kubectl config use-context gke_k8s-skaffold_us-central1-a_integration-tests --v=0     
error: converting  to : type names don't match (Unknown, RawExtension), and no conversion 'func (runtime.Unknown, runtime.RawExtension) error' registered.
➜  skaffold git:(fix_container_str) ✗ minikube delete
🔥  Deleting "minikube" in docker ...
🔥  Deleting container "minikube" ...
🔥  Removing /Users/tejaldesai/.minikube/machines/minikube ...
💀  Removed all traces of the "minikube" cluster.
➜  skaffold git:(fix_container_str) ✗ kubectl config use-context gke_tejal-test_us-central1-a_dump                        
Switched to context "gke_tejal-test_us-central1-a_dump".
➜  skaffold git:(fix_container_str) ✗ 

I couldn't find the minikube logs since i deleted the cluster

➜  skaffold git:(fix_container_str) ✗ minikube logs
🤷  Profile "minikube" not found. Run "minikube profile list" to view all profiles.
👉  To start a cluster, run: "minikube start"

@tstromberg
Copy link
Contributor

tstromberg commented Mar 17, 2021

My suspicion, based on the error message, is that this may be caused by new annotations minikube adds to the KUBECONFIG file. It may be that your version of kubectl (v1.16.0) is too old to accept them.

Here is the PR that added this feature to minikube 1.17.x: #10126

@tejal29
Copy link
Contributor

tejal29 commented Mar 17, 2021

My kubectl version is

kubectl version                                             
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.3", GitCommit:"2d3c76f9091b6bec110a5e63777c332469e0cba2", GitTreeState:"clean", BuildDate:"2019-08-19T11:13:54Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"darwin/amd64"}
Unable to connect to the server: error executing access token command "/Users/tejaldesai/Downloads/google-cloud-sdk2/bin/gcloud config config-helper --format=json": err=fork/exec /Users/tejaldesai/Downloads/google-cloud-sdk2/bin/gcloud: no such file or directory output= stderr=

@tejal29
Copy link
Contributor

tejal29 commented Mar 17, 2021

WORKAROUND:
After updating kubectl to version v1.17+. i was able to switch context after creating a minikube cluster.

➜  skaffold git:(fix_container_str) ✗ kubectl version                   
Client Version: version.Info{Major:"1", Minor:"17+", GitVersion:"v1.17.17-dispatcher", GitCommit:"a39a896b5018d0c800124a36757433c660fd0880", GitTreeState:"clean", BuildDate:"2021-01-28T22:06:27Z", GoVersion:"go1.13.9", Compiler:"gc", Platform:"darwin/amd64"}

➜  skaffold git:(fix_container_str) ✗ minikube start
😄  minikube v1.18.0 on Darwin 11.2.1
✨  Using the docker driver based on user configuration
.....
    ▪ Want kubectl v1.20.2? Try 'minikube kubectl -- get pods -A'
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
➜  skaffold git:(fix_container_str) ✗ kubectl config use-context gke_tejal-test_us-central1-a_dump
Switched to context "gke_tejal-test_us-central1-a_dump".
➜  skaffold git:(fix_container_str) ✗                                                             

@tstromberg tstromberg changed the title error: converting to : type names don't match (Unknown, RawExtension), and no conversion 'func (runtime.Unknown, runtime.RawExtension) error' registered. from config kubectl <1.17 fails with error: type names don't match (Unknown, RawExtension) Mar 17, 2021
@afbjorklund
Copy link
Collaborator

This is why we include "minikube kubectl", to get a version that matches the cluster.

@afbjorklund afbjorklund added kind/support Categorizes issue or PR as a support question. cmd/kubectl Issues with the "kubectl" command labels Mar 18, 2021
@spowelljr spowelljr added long-term-support Long-term support issues that can't be fixed in code and removed triage/long-term-support labels May 19, 2021
@JakeAtTurner
Copy link

JakeAtTurner commented May 19, 2021

I have a Mac OS system
I had the same problem above but with kubens

_> kubectl config view
error: converting to : type names don't match (Unknown, RawExtension), and no conversion 'func (runtime.Unknown, runtime.RawExtension) error' registered.

to fix the issue use the following

You may have to delete kubectl if it is > v17 and already exists

_> rm '/usr/local/bin/kubectl'
_> brew install kubernetes-cli
_> brew link kubernetes-cli

@yogendradabi3
Copy link

brew upgrade kubernetes-cli worked for me

@kevin85421
Copy link

I have a Mac OS system
I had the same problem above but with kubens

_> kubectl config view
error: converting to : type names don't match (Unknown, RawExtension), and no conversion 'func (runtime.Unknown, runtime.RawExtension) error' registered.

to fix the issue use the following

You may have to delete kubectl if it is > v17 and already exists

_> rm '/usr/local/bin/kubectl'
_> brew install kubernetes-cli
_> brew link kubernetes-cli

@JakeAtTurner Thank you! This works for me.

@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 25, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Sep 24, 2021
@sharifelgamal
Copy link
Collaborator

We actually warn when the installed version of kubectl on the host doesn't match the version of kubernetes installed by minikube. Using minikube kubectl or upgrading your installed version of kubectl is the answer here.

@ozanyldzgithuboffical
Copy link

Deleting config and delete/start minikube by re-installing cluster is not working.

The solution is that you need to install compatible version of kubectl.exe to your installed kubernetes version.on your mini-kube. I have v1.24.0 kubernetes and I use v1.22.0 kubectl.exe . Now it is working successfully.

@vrajannagari
Copy link

Following worked for me for a similar issue.

rm '/usr/local/bin/kubectl'
brew install kubernetes-cli
brew link kubernetes-cli

@mtg-tech
Copy link

mtg-tech commented Aug 3, 2022

I have Windows OS
I get this error After

_> kubectl config view
error: converting to : type names don't match (Unknown, RawExtension), and no conversion 'func (runtime.Unknown, runtime.RawExtension) error' registered.

What to Do Now...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cmd/kubectl Issues with the "kubectl" command kind/support Categorizes issue or PR as a support question. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. long-term-support Long-term support issues that can't be fixed in code
Projects
None yet
Development

No branches or pull requests