Skip to content

Commit ab6b9ae

Browse files
committed
Update kubetl subresource documentation
Signed-off-by: Maciej Szulik <[email protected]>
1 parent d2f678e commit ab6b9ae

File tree

3 files changed

+10
-19
lines changed

3 files changed

+10
-19
lines changed

content/en/docs/reference/kubectl/conventions.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ For a stable output in a script:
2222

2323
## Subresources
2424

25-
* You can use the `--subresource` beta flag for kubectl commands like `get`, `patch`,
26-
`edit` and `replace` to fetch and update subresources for all resources that
27-
support them. Currently, only the `status` and `scale` subresources are supported.
25+
* You can use the `--subresource` argument for kubectl subcommands such as `get`, `patch`,
26+
`edit`, `apply` and `replace` to fetch and update subresources for all resources that
27+
support them. In Kubernetes version {{< skew currentVersion >}}, only the `status`, `scale`
28+
and `resize` subresources are supported.
2829
* For `kubectl edit`, the `scale` subresource is not supported. If you use `--subresource` with
2930
`kubectl edit` and specify `scale` as the subresource, the command will error out.
3031
* The API contract against a subresource is identical to a full resource. While updating the

content/en/docs/tasks/extend-kubernetes/custom-resources/custom-resource-definition-versioning.md

-10
Original file line numberDiff line numberDiff line change
@@ -1094,16 +1094,6 @@ The following is an example procedure to upgrade from `v1beta1` to `v1`.
10941094
3. Remove `v1beta1` from the CustomResourceDefinition `status.storedVersions` field.
10951095

10961096
{{< note >}}
1097-
The flag `--subresource` is used with the kubectl get, patch, edit, and replace commands to
1098-
fetch and update the subresources, `status` and `scale`, for all the API resources that
1099-
support them. This flag is available starting from kubectl version v1.24. Previously, reading
1100-
subresources (like `status`) via kubectl involved using `kubectl --raw`, and updating
1101-
subresources using kubectl was not possible at all. Starting from v1.24, the `kubectl` tool
1102-
can be used to edit or patch the `status` subresource on a CRD object. See [How to patch a Deployment using the subresource flag](/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch/#scale-kubectl-patch).
1103-
1104-
This page is part of the documentation for Kubernetes v{{< skew currentVersion >}}.
1105-
If you are running a different version of Kubernetes, consult the documentation for that release.
1106-
11071097
Here is an example of how to patch the `status` subresource for a CRD object using `kubectl`:
11081098
```bash
11091099
kubectl patch customresourcedefinitions <CRD_Name> --subresource='status' --type='merge' -p '{"status":{"storedVersions":["v1"]}}'

content/en/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -429,13 +429,13 @@ kubectl patch deployment patch-demo --patch '{"spec": {"template": {"spec": {"co
429429

430430
### Update an object's replica count using `kubectl patch` with `--subresource` {#scale-kubectl-patch}
431431

432-
{{< feature-state for_k8s_version="v1.24" state="alpha" >}}
433-
434432
The flag `--subresource=[subresource-name]` is used with kubectl commands like get, patch,
435-
edit and replace to fetch and update `status` and `scale` subresources of the resources
436-
(applicable for kubectl version v1.24 or more). This flag is used with all the API resources
437-
(built-in and CRs) that have `status` or `scale` subresource. Deployment is one of the
438-
examples which supports these subresources.
433+
edit, apply and replace to fetch and update `status`, `scale` and `resize` subresource of the
434+
resources you specify. You can specify a subresource for any of the Kubernetes API resources
435+
(built-in and CRs) that have `status`, `scale` or `resize` subresource.
436+
437+
For example, a Deployment has a `status` subresource and a `scale` subresource, so you can
438+
use `kubectl` to get or modify just the `status` subresource of a Deployment.
439439

440440
Here's a manifest for a Deployment that has two replicas:
441441

0 commit comments

Comments
 (0)