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

Determine what happens to the "kubectl convert" functionality #725

Closed
seans3 opened this issue Sep 25, 2019 · 24 comments · Fixed by kubernetes/kubernetes#96190
Closed

Determine what happens to the "kubectl convert" functionality #725

seans3 opened this issue Sep 25, 2019 · 24 comments · Fixed by kubernetes/kubernetes#96190
Assignees
Labels
area/kubectl kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cli Categorizes an issue or PR as relevant to SIG CLI.

Comments

@seans3
Copy link
Contributor

seans3 commented Sep 25, 2019

kubectl convert is deprecated

The initial kubectl convert deprecation was announced prior to release 1.13. Following the Kubernetes deprecation policy, this kubectl subcommand is now eligible to be removed in release 1.17. The following are options for next steps as this convert functionality is removed from kubectl. If you have an opinion, please add comments to this issue so that we can quickly drive consensus and make a decision on which option we will pursue.

Convert as a Plugin

We could move the kubectl convert code into a plugin named kubectl-convert. The invocation of the plugin would mimic the current command: kubectl convert.

  • Pro: Users depending on this functionality will still be able to convert resource versions.
  • Pro: The command will appear similar. Naming the plugin kubectl-convert will ensure kubectl users can type the same command: kubectl convert.
  • Con: The users will have to find and download this separate binary.
  • Con: The plugin would have to vendor in most of the Kubernetes.

Convert as a Binary

  • Pro: Users depending on this functionality will still be able to convert resource versions.
  • Con: The users will have to find and download this separate binary.
  • Con: The plugin would have to vendor in most of the Kubernetes.

Convert into the API Server

  • Pro: Users depending on this functionality will still be able to convert resource versions.
  • Pro: Convert code already lives in the API machinery.
  • Con: It may take a long time to get this into the API Server.

Drop convert functionality

  • Pro: This will be the simplest to implement; just remove kubectl convert subcommand code.
  • Con: Users depending on this functionality will NOT be able to convert resource versions.
@seans3
Copy link
Contributor Author

seans3 commented Sep 25, 2019

/sig cli
/sig api-machinery
/area kubectl
/kind cleanup

@k8s-ci-robot k8s-ci-robot added sig/cli Categorizes an issue or PR as relevant to SIG CLI. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Sep 25, 2019
@k8s-ci-robot
Copy link
Contributor

@seans3: The label(s) sig/apimachinery cannot be applied. These labels are supported: api-review, community/discussion, community/maintenance, community/question, cuj/build-train-deploy, cuj/multi-user, platform/aws, platform/azure, platform/gcp, platform/minikube, platform/other

In response to this:

/sig cli
/sig apimachinery
/area kubectl
/kind cleanup

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added area/kubectl sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Sep 25, 2019
@seans3
Copy link
Contributor Author

seans3 commented Sep 25, 2019

/assign @liggitt
/assign @deads2k

@seans3
Copy link
Contributor Author

seans3 commented Sep 25, 2019

/assign @soltysh
/assign @pwittrock

@deads2k
Copy link
Contributor

deads2k commented Sep 26, 2019

I think some of this going to come down on jordan, myself, and Daniel agreeing on the role of staging. I see it as a way to organize our components and some aspects of it are valid to depend upon (client-go and api for instance) and others makes less sense (a kube-controller-manager or kube-apiserver). I think building a separate command that lives near our internal APIs make sense and I'd rather do that that coerce it into a kube-apiserver subcommand. Doing that would give a cleaner example to others trying to build a similar thing (think of the position cert-manager is in today).

@liggitt
Copy link
Member

liggitt commented Oct 4, 2019

Discussed this in the code organization call yesterday.

The Convert as a Binary option seemed like the best immediate step to unblock this. Placing the command within the k8s.io/kubernetes/cmd package to begin with would give it access to the internal types/conversions without needing to vendor anything. When the discussion about moving those types/conversions to staging is settled, the command could be moved to staging along with them, if desired.

(note that this differs from the Convert as a Plugin option only by the name of the command chosen... if we named the command kubectl-convert, and kept the invocation consistent with the current invocation, we would effectively have created a command that could be used as a plugin, if desired, or standalone)

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/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 Jan 2, 2020
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/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 Feb 1, 2020
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@soltysh
Copy link
Contributor

soltysh commented Mar 4, 2020

/reopen
/remove-lifecycle rottem
/lifecycle frozen

@k8s-ci-robot k8s-ci-robot reopened this Mar 4, 2020
@k8s-ci-robot
Copy link
Contributor

@soltysh: Reopened this issue.

In response to this:

/reopen
/remove-lifecycle rottem
/lifecycle frozen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Mar 4, 2020
@tavin
Copy link

tavin commented Jul 13, 2020

Even if we'll have to install something extra, glad to see this command will remain available and without making a request to the API service (right?)

@eddiezane
Copy link
Member

/priority important-soon

@k8s-ci-robot k8s-ci-robot added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Jul 22, 2020
@ghostsquad
Copy link

just curious, why is convert deprecated?

@seans3
Copy link
Contributor Author

seans3 commented Aug 5, 2020

convert contains inappropriate dependencies. convert necessarily depends on internal types (in order to convert), but kubectl should not depend on these. In fact, no software outside api server should depend on internal types.

@seans3
Copy link
Contributor Author

seans3 commented Aug 5, 2020

The deprecation plan is to create convert as a plugin or separate binary. So the functionality would still exist; just not in kubectl.

@angadrandhawa
Copy link

angadrandhawa commented Dec 16, 2020

Hey guys, where can I find the convert plugin ?
when i use Krew and do the kubectl krew search i dont see it in the list. Was this plugin released ?

@superbrothers
Copy link
Member

superbrothers commented Dec 22, 2020

@angadrandhawa I don't know where the binary is, but you can build from the source code:

go get -u k8s.io/kubernetes/cmd/kubectl-convert

@lagivan
Copy link

lagivan commented Mar 24, 2021

I'm missing the kubectl convert feature, cannot find a plugin or binary. I need it to upgrade from 1.15. The command above does not work anymore. Please advise.

@soltysh
Copy link
Contributor

soltysh commented Mar 24, 2021

Yeah, apologies for that we missed that bit in the last release, there will be binaries available in the upcoming 1.21 version and I'm planning to include them in the krew for ease of use.

@ashokponkumar
Copy link

I'm missing the kubectl convert feature, cannot find a plugin or binary. I need it to upgrade from 1.15. The command above does not work anymore. Please advise.

In Konveyor Move2Kube we had added the conversion capability for kubernetes yamls. After installing move2kube BLEEDING_EDGE='true' bash <(curl https://raw.githubusercontent.com/konveyor/move2kube/main/scripts/install.sh), You will have to do move2kube translate -s <folder containing your k8s yamls>. If you are interested in specific kubernetes api resource verisons, you can create a cluster.yaml file, and edit the intended versions, and then add it to the same folder as your source, and move2kube will migrate your yamls to those specific versions.

If you would want to get the versions in a specific cluster, set it in context for your kubectl and then run move2kube collect, and a cluster yaml file will be created for your cluster in m2k_collect folder, which you can then add to the source folder.

This could be a stop gap solution till kubectl convert is released in 1.21 as @soltysh has mentioned.

Hope it helps.

@mikaelkundert
Copy link

mikaelkundert commented May 24, 2021

I'm running

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.1", GitCommit:"5e58841cce77d4bc13713ad2b91fa0d961e69192", GitTreeState:"clean", BuildDate:"2021-05-12T14:18:45Z", GoVersion:"go1.16.4", Compiler:"gc", Platform:"linux/amd64"}

...and I can't use this command.

I'm confused, how do I use this? I have no clue yet how I migrate my deployments from extensions/v1beta1 to apps/v1. Amazon EKS update guide suggested to use this tool.

I also tried installing it from source, but got this error:

$ go get -u k8s.io/kubernetes/cmd/kubectl-convert
go get: k8s.io/kubernetes@v1.15.0-alpha.0 updating to
	k8s.io/kubernetes@v1.21.1 requires
	k8s.io/apiextensions-apiserver@v0.0.0: reading k8s.io/apiextensions-apiserver/go.mod at revision v0.0.0: unknown revision v0.0.0

@crocokyle
Copy link

I also have the same error as @mikaelkundert on 1.21.2. Here is the verbose output

$ go get -v k8s.io/kubernetes/cmd/kubectl-convert
get "k8s.io/api": found meta tag vcs.metaImport{Prefix:"k8s.io/api", VCS:"git", RepoRoot:"https://github.com/kubernetes/api"} at //k8s.io/api?go-get=1
get "k8s.io/kube-controller-manager": found meta tag vcs.metaImport{Prefix:"k8s.io/kube-controller-manager", VCS:"git", RepoRoot:"https://github.com/kubernetes/kube-controller-manager"} at //k8s.io/kube-controller-manager?go-get=1
get "k8s.io/cri-api": found meta tag vcs.metaImport{Prefix:"k8s.io/cri-api", VCS:"git", RepoRoot:"https://github.com/kubernetes/cri-api"} at //k8s.io/cri-api?go-get=1
get "k8s.io/sample-apiserver": found meta tag vcs.metaImport{Prefix:"k8s.io/sample-apiserver", VCS:"git", RepoRoot:"https://github.com/kubernetes/sample-apiserver"} at //k8s.io/sample-apiserver?go-get=1
get "k8s.io/metrics": found meta tag vcs.metaImport{Prefix:"k8s.io/metrics", VCS:"git", RepoRoot:"https://github.com/kubernetes/metrics"} at //k8s.io/metrics?go-get=1
get "k8s.io/component-base": found meta tag vcs.metaImport{Prefix:"k8s.io/component-base", VCS:"git", RepoRoot:"https://github.com/kubernetes/component-base"} at //k8s.io/component-base?go-get=1
get "k8s.io/client-go": found meta tag vcs.metaImport{Prefix:"k8s.io/client-go", VCS:"git", RepoRoot:"https://github.com/kubernetes/client-go"} at //k8s.io/client-go?go-get=1
get "k8s.io/csi-translation-lib": found meta tag vcs.metaImport{Prefix:"k8s.io/csi-translation-lib", VCS:"git", RepoRoot:"https://github.com/kubernetes/csi-translation-lib"} at //k8s.io/csi-translation-lib?go-get=1
get "k8s.io/component-helpers": found meta tag vcs.metaImport{Prefix:"k8s.io/component-helpers", VCS:"git", RepoRoot:"https://github.com/kubernetes/component-helpers"} at //k8s.io/component-helpers?go-get=1
get "k8s.io/apimachinery": found meta tag vcs.metaImport{Prefix:"k8s.io/apimachinery", VCS:"git", RepoRoot:"https://github.com/kubernetes/apimachinery"} at //k8s.io/apimachinery?go-get=1
get "k8s.io/kube-proxy": found meta tag vcs.metaImport{Prefix:"k8s.io/kube-proxy", VCS:"git", RepoRoot:"https://github.com/kubernetes/kube-proxy"} at //k8s.io/kube-proxy?go-get=1
get "k8s.io/legacy-cloud-providers": found meta tag vcs.metaImport{Prefix:"k8s.io/legacy-cloud-providers", VCS:"git", RepoRoot:"https://github.com/kubernetes/legacy-cloud-providers"} at //k8s.io/legacy-cloud-providers?go-get=1
get "k8s.io/kube-aggregator": found meta tag vcs.metaImport{Prefix:"k8s.io/kube-aggregator", VCS:"git", RepoRoot:"https://github.com/kubernetes/kube-aggregator"} at //k8s.io/kube-aggregator?go-get=1
get "k8s.io/apiextensions-apiserver": found meta tag vcs.metaImport{Prefix:"k8s.io/apiextensions-apiserver", VCS:"git", RepoRoot:"https://github.com/kubernetes/apiextensions-apiserver"} at //k8s.io/apiextensions-apiserver?go-get=1
get "k8s.io/kubelet": found meta tag vcs.metaImport{Prefix:"k8s.io/kubelet", VCS:"git", RepoRoot:"https://github.com/kubernetes/kubelet"} at //k8s.io/kubelet?go-get=1
get "k8s.io/controller-manager": found meta tag vcs.metaImport{Prefix:"k8s.io/controller-manager", VCS:"git", RepoRoot:"https://github.com/kubernetes/controller-manager"} at //k8s.io/controller-manager?go-get=1
get "k8s.io/kube-scheduler": found meta tag vcs.metaImport{Prefix:"k8s.io/kube-scheduler", VCS:"git", RepoRoot:"https://github.com/kubernetes/kube-scheduler"} at //k8s.io/kube-scheduler?go-get=1
get "k8s.io/apiserver": found meta tag vcs.metaImport{Prefix:"k8s.io/apiserver", VCS:"git", RepoRoot:"https://github.com/kubernetes/apiserver"} at //k8s.io/apiserver?go-get=1
get "k8s.io/kubectl": found meta tag vcs.metaImport{Prefix:"k8s.io/kubectl", VCS:"git", RepoRoot:"https://github.com/kubernetes/kubectl"} at //k8s.io/kubectl?go-get=1
get "k8s.io/cli-runtime": found meta tag vcs.metaImport{Prefix:"k8s.io/cli-runtime", VCS:"git", RepoRoot:"https://github.com/kubernetes/cli-runtime"} at //k8s.io/cli-runtime?go-get=1
get "k8s.io/cluster-bootstrap": found meta tag vcs.metaImport{Prefix:"k8s.io/cluster-bootstrap", VCS:"git", RepoRoot:"https://github.com/kubernetes/cluster-bootstrap"} at //k8s.io/cluster-bootstrap?go-get=1
get "k8s.io/mount-utils": found meta tag vcs.metaImport{Prefix:"k8s.io/mount-utils", VCS:"git", RepoRoot:"https://github.com/kubernetes/mount-utils"} at //k8s.io/mount-utils?go-get=1
get "k8s.io/cloud-provider": found meta tag vcs.metaImport{Prefix:"k8s.io/cloud-provider", VCS:"git", RepoRoot:"https://github.com/kubernetes/cloud-provider"} at //k8s.io/cloud-provider?go-get=1
get "k8s.io/code-generator": found meta tag vcs.metaImport{Prefix:"k8s.io/code-generator", VCS:"git", RepoRoot:"https://github.com/kubernetes/code-generator"} at //k8s.io/code-generator?go-get=1
go get: k8s.io/kubernetes@v1.15.0-alpha.0 updating to
        k8s.io/kubernetes@v1.21.2 requires
        k8s.io/api@v0.0.0: reading k8s.io/api/go.mod at revision v0.0.0: unknown revision v0.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubectl kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cli Categorizes an issue or PR as relevant to SIG CLI.
Projects
None yet
Development

Successfully merging a pull request may close this issue.