Skip to content

Conversation

@soltysh
Copy link
Contributor

@soltysh soltysh commented Feb 18, 2025

Description

Updates kubectl subresource documentation

Issue

Ref: kubernetes/enhancements#2590

/assign @ardaguclu

@k8s-ci-robot k8s-ci-robot added the language/en Issues or PRs related to English language label Feb 18, 2025
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 18, 2025
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 18, 2025
@netlify
Copy link

netlify bot commented Feb 18, 2025

👷 Deploy Preview for kubernetes-io-vnext-staging processing.

Name Link
🔨 Latest commit ab6b9ae
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-vnext-staging/deploys/67b5b05cc1e1be0008539f0c

@ardaguclu
Copy link
Member

ardaguclu commented Feb 18, 2025

That looks nice. Thanks.
/lgtm
from sig-cli POV

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 18, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 8f8d6c99068f25e488e6c48d67b5da1246ce9388

@netlify
Copy link

netlify bot commented Feb 18, 2025

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit ab6b9ae
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/67b5b05c9c6c360008d5abf6
😎 Deploy Preview https://deploy-preview-49824--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sftim
Copy link
Contributor

sftim commented Feb 18, 2025

/sig cli

@k8s-ci-robot k8s-ci-robot added the sig/cli Categorizes an issue or PR as relevant to SIG CLI. label Feb 18, 2025
Copy link
Contributor

@sftim sftim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, try to avoid unrelated whitespace changes as they can provoke merge conflicts.

We could merge this but I would tweak it; the CRD page mentions some details relevant to old (v1.23) Kubernetes that I don't think we need to keep.

So:
/hold
OK to unhold if we want to ship this and iterate.

/approve
I support the intent of this PR.


* You can use the `--subresource` beta flag for kubectl commands like `get`, `patch`,
`edit` and `replace` to fetch and update subresources for all resources that
* You can use the `--subresource` flag for kubectl commands like `get`, `patch`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit)

Suggested change
* You can use the `--subresource` flag for kubectl commands like `get`, `patch`,
* You can use the `--subresource` argument for kubectl subcommands such as `get`, `patch`,

edit and replace to fetch and update `status` and `scale` subresources of the resources
(applicable for kubectl version v1.24 or more). This flag is used with all the API resources
edit, apply and replace to fetch and update `status` and `scale` subresources of the resources
(applicable for kubectl version v1.24 or newer). This flag is used with all the API resources
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(applicable for kubectl version v1.24 or newer). This flag is used with all the API resources
you specify. You can specify a subresource for any of the Kubernetes API resources

Comment on lines 435 to 436
(built-in and CRs) that have `status` or `scale` subresource. Deployment is one of the
examples which supports these subresources.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(built-in and CRs) that have `status` or `scale` subresource. Deployment is one of the
examples which supports these subresources.
(built-in and CRs) that have either a `status` or `scale` subresource, if they have both.
For example, a Deployment has a `status` subresource and a `scale` subresource, so you can use
`kubectl` to get or modify just the `status` subresource of a Deployment.

storage version, which is `v1`.
3. Remove `v1beta1` from the CustomResourceDefinition `status.storedVersions` field.

{{< note >}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we could simplify the contents of this note to:

Here is an example of how to patch the `status` subresource for a CRD object using `kubectl`:

```bash
kubectl patch customresourcedefinitions <CRD_Name> --subresource='status' --type='merge' -p '{"status":{"storedVersions":["v1"]}}'
```

WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think it's reasonable. Previously --subresource was new, so we needed explicit info when it's available. But since it's beta for all supported releases, we can just mention the example only.

`edit` and `replace` to fetch and update subresources for all resources that
* You can use the `--subresource` flag for kubectl commands like `get`, `patch`,
`edit`, `apply` and `replace` to fetch and update subresources for all resources that
support them. Currently, only the `status` and `scale` subresources are supported.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
support them. Currently, only the `status` and `scale` subresources are supported.
support them. In Kubernetes version {{< skew currentVersion >}}, only the `status` and `scale` subresources are supported.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 18, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sftim

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 18, 2025
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 19, 2025
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 19, 2025
@soltysh
Copy link
Contributor Author

soltysh commented Feb 19, 2025

BTW, try to avoid unrelated whitespace changes as they can provoke merge conflicts.

Will drop them, my editor by default removes all whitespaces from line endings.

We could merge this but I would tweak it; the CRD page mentions some details relevant to old (v1.23) Kubernetes that I don't think we need to keep.

So: /hold OK to unhold if we want to ship this and iterate.

Updated, so droping the hold

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 19, 2025
@sftim
Copy link
Contributor

sftim commented Feb 20, 2025

Changes since LGTM in #49824 (comment) are trivial
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 20, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: d49a4500ff4846d81294168b6e0684b56f4f1a92

@k8s-ci-robot k8s-ci-robot merged commit af7cde7 into kubernetes:dev-1.33 Feb 20, 2025
6 checks passed
@soltysh soltysh deleted the subresource_docs branch February 20, 2025 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/cli Categorizes an issue or PR as relevant to SIG CLI. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants