Fix kubectl reference table of '--generator' (#14983)

* fix `--generator` in `kubectl run` guide

* distinguish api group from kubectl command in reference table
pull/14997/head
zwwhdls 2019-06-20 03:02:34 +08:00 committed by Kubernetes Prow Robot
parent a86bc5ca13
commit 31fce9bee1
1 changed files with 9 additions and 13 deletions

View File

@ -37,19 +37,15 @@ For `kubectl run` to satisfy infrastructure as code:
You can create the following resources using `kubectl run` with the `--generator` flag:
| Resource | kubectl command |
|---------------------------------|---------------------------------------------------|
| Pod | `kubectl run --generator=run-pod/v1` |
| Replication controller | `kubectl run --generator=run/v1` |
| Deployment | `kubectl run --generator=extensions/v1beta1` |
| -for an endpoint (default) | `kubectl run --generator=deployment/v1beta1` |
| Deployment | `kubectl run --generator=apps/v1beta1` |
| -for an endpoint (recommended) | `kubectl run --generator=deployment/apps.v1beta1` |
| Job | `kubectl run --generator=job/v1` |
| CronJob | `kubectl run --generator=batch/v1beta1` |
| -for an endpoint (default) | `kubectl run --generator=cronjob/v1beta1` |
| CronJob | `kubectl run --generator=batch/v2alpha1` |
| -for an endpoint (deprecated) | `kubectl run --generator=cronjob/v2alpha1` |
| Resource | api group | kubectl command |
|---------------------------------|--------------------|---------------------------------------------------|
| Pod | v1 | `kubectl run --generator=run-pod/v1` |
| Replication controller | v1 | `kubectl run --generator=run/v1` |
| Deployment (deprecated) | extensions/v1beta1 | `kubectl run --generator=deployment/v1beta1` |
| Deployment (deprecated) | apps/v1beta1 | `kubectl run --generator=deployment/apps.v1beta1` |
| Job (deprecated) | batch/v1 | `kubectl run --generator=job/v1` |
| CronJob (default) | batch/v1beta1 | `kubectl run --generator=cronjob/v1beta1` |
| CronJob (deprecated) | batch/v2alpha1 | `kubectl run --generator=cronjob/v2alpha1` |
If you do not specify a generator flag, other flags prompt you to use a specific generator. The following table lists the flags that force you to use specific generators, depending on the version of the cluster: