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

Add link to kubectl convert #40737

Merged
merged 2 commits into from
Jul 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions content/en/docs/reference/using-api/deprecation-guide.md
piradata marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -351,14 +351,26 @@ to locate use of deprecated APIs.
* Update custom integrations and controllers to call the non-deprecated APIs
* Change YAML files to reference the non-deprecated APIs

You can use the `kubectl-convert` command (`kubectl convert` prior to v1.20)
to automatically convert an existing object:
You can use the `kubectl convert` command to automatically convert an existing object:

`kubectl-convert -f <file> --output-version <group>/<version>`.
`kubectl convert -f <file> --output-version <group>/<version>`.

For example, to convert an older Deployment to `apps/v1`, you can run:

`kubectl-convert -f ./my-deployment.yaml --output-version apps/v1`
`kubectl convert -f ./my-deployment.yaml --output-version apps/v1`

Note that this may use non-ideal default values. To learn more about a specific
This conversion may use non-ideal default values. To learn more about a specific
resource, check the Kubernetes [API reference](/docs/reference/kubernetes-api/).

{{< note >}}
The `kubectl convert` tool is not installed by default, although
in fact it once was part of `kubectl` itself. For more details, you can read the
[deprecation and removal issue](https://github.com/kubernetes/kubectl/issues/725)
for the built-in subcommand.

To learn how to set up `kubectl convert` on your computer, visit the page that is right for your
operating system:
[Linux](/docs/tasks/tools/install-kubectl-linux/#install-kubectl-convert-plugin),
[macOS](/docs/tasks/tools/install-kubectl-macos/#install-kubectl-convert-plugin), or
[Windows](/docs/tasks/tools/install-kubectl-windows/#install-kubectl-convert-plugin).
{{< /note >}}