Skip to content

Commit

Permalink
Fix kubectl reference table of '--generator' (#14983)
Browse files Browse the repository at this point in the history
* fix `--generator` in `kubectl run` guide

* distinguish api group from kubectl command in reference table
  • Loading branch information
zwwhdls authored and k8s-ci-robot committed Jun 19, 2019
1 parent a86bc5c commit 31fce9b
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions content/en/docs/reference/kubectl/conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit 31fce9b

Please sign in to comment.