Revert v1.17 release changes on v1.16 branch (#18123)
This reverts commits:1131f8603e.cf5b8b200c.75de70a431.dff2f7b960.cf925bb688.ffd1363c0e.87a2cafb20.ffe259d6f2.
This commit is contained in:
committed by
Kubernetes Prow Robot
parent
5733771d62
commit
065ccd94be
@@ -28,47 +28,51 @@ For `kubectl run` to satisfy infrastructure as code:
|
||||
|
||||
* Tag the image with a version-specific tag and don't move that tag to a new version. For example, use `:v1234`, `v1.2.3`, `r03062016-1-4`, rather than `:latest` (For more information, see [Best Practices for Configuration](/docs/concepts/configuration/overview/#container-images)).
|
||||
* Capture the parameters in a checked-in script, or at least use `--record` to annotate the created objects with the command line for an image that is lightly parameterized.
|
||||
* Pin to a specific [generator](#generators) version, such as `kubectl run --generator=run-pod/v1`.
|
||||
* Check in the script for an image that is heavily parameterized.
|
||||
* Switch to configuration files checked into source control for features that are needed, but not expressible via `kubectl run` flags.
|
||||
* Pin to a specific [generator](#generators) version, such as `kubectl run --generator=deployment/v1beta1`.
|
||||
|
||||
#### Generators
|
||||
|
||||
You can create the following resources using `kubectl run` with the `--generator` flag:
|
||||
|
||||
{{< table caption="Resources you can create using kubectl run" >}}
|
||||
| Resource | API group | kubectl command |
|
||||
|--------------------------------------|--------------------|---------------------------------------------------|
|
||||
| Pod | v1 | `kubectl run --generator=run-pod/v1` |
|
||||
| ReplicationController _(deprecated)_ | 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 _(deprecated)_ | batch/v2alpha1 | `kubectl run --generator=cronjob/v2alpha1` |
|
||||
| CronJob _(deprecated)_ | batch/v1beta1 | `kubectl run --generator=cronjob/v1beta1` |
|
||||
{{< /table >}}
|
||||
| Resource | api group | kubectl command |
|
||||
|-------------------------------------|--------------------|---------------------------------------------------|
|
||||
| Pod | v1 | `kubectl run --generator=run-pod/v1` |
|
||||
| Replication controller (deprecated) | 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 (deprecated) | batch/v1beta1 | `kubectl run --generator=cronjob/v1beta1` |
|
||||
| CronJob (deprecated) | batch/v2alpha1 | `kubectl run --generator=cronjob/v2alpha1` |
|
||||
|
||||
{{< note >}}
|
||||
Generators other than `run-pod/v1` are deprecated.
|
||||
`kubectl run --generator` except for `run-pod/v1` is deprecated in v1.12.
|
||||
{{< /note >}}
|
||||
|
||||
If you explicitly set `--generator`, kubectl uses the generator you specified. If you invoke `kubectl run` and don't specify a generator, kubectl automatically selects which generator to use based on the other flags you set. The following table lists flags and the generators that are activated if you didn't specify one yourself:
|
||||
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:
|
||||
|
||||
{{< table caption="kubectl run flags and the resource they imply" >}}
|
||||
| Flag | Generated Resource |
|
||||
|-------------------------|-----------------------|
|
||||
| `--schedule=<schedule>` | CronJob |
|
||||
| `--restart=Always` | Deployment |
|
||||
| `--restart=OnFailure` | Job |
|
||||
| `--restart=Never` | Pod |
|
||||
{{< /table >}}
|
||||
| Generated Resource | Cluster v1.4 and later | Cluster v1.3 | Cluster v1.2 | Cluster v1.1 and earlier |
|
||||
|:----------------------:|------------------------|-----------------------|--------------------------------------------|--------------------------------------------|
|
||||
| Pod | `--restart=Never` | `--restart=Never` | `--generator=run-pod/v1` | `--restart=OnFailure` OR `--restart=Never` |
|
||||
| Replication Controller | `--generator=run/v1` | `--generator=run/v1` | `--generator=run/v1` | `--restart=Always` |
|
||||
| Deployment | `--restart=Always` | `--restart=Always` | `--restart=Always` | N/A |
|
||||
| Job | `--restart=OnFailure` | `--restart=OnFailure` | `--restart=OnFailure` OR `--restart=Never` | N/A |
|
||||
| Cron Job | `--schedule=<cron>` | N/A | N/A | N/A |
|
||||
|
||||
If you don't specify a generator, kubectl pays attention to other flags in the following order:
|
||||
{{< note >}}
|
||||
These flags use a default generator only when you have not specified any flag.
|
||||
This means that when you combine `--generator` with other flags the generator that you specified later does not change. For example, in a cluster v1.4, if you initially specify
|
||||
`--restart=Always`, a Deployment is created; if you later specify `--restart=Always`
|
||||
and `--generator=run/v1`, a Replication Controller is created.
|
||||
This enables you to pin to a specific behavior with the generator,
|
||||
even when the default generator is changed later.
|
||||
{{< /note >}}
|
||||
|
||||
1. `--schedule`
|
||||
1. `--restart`
|
||||
The flags set the generator in the following order: first the `--schedule` flag, then the `--restart` policy flag, and finally the `--generator` flag.
|
||||
|
||||
You can use the `--dry-run` flag to preview the object that would be sent to your cluster, without really submitting it.
|
||||
To check the final resource that was created, use the `--dry-run`
|
||||
flag, which only prints the object that would be sent to the cluster without really sending it.
|
||||
|
||||
### `kubectl apply`
|
||||
|
||||
|
||||
@@ -40,6 +40,13 @@ kubectl [flags]
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">log to standard error as well as files</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--application-metrics-count-limit int Default: 100</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">Max number of application metrics to store (per container)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--as string</td>
|
||||
</tr>
|
||||
@@ -61,6 +68,13 @@ kubectl [flags]
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">Path to the file containing Azure container registry configuration information.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--boot-id-file string Default: "/proc/sys/kernel/random/boot_id"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">Comma-separated list of files to check for boot-id. Use the first one that exists.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--cache-dir string Default: "~/.kube/http-cache"</td>
|
||||
</tr>
|
||||
@@ -103,6 +117,27 @@ kubectl [flags]
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">The name of the kubeconfig cluster to use</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--container-hints string Default: "/etc/cadvisor/container_hints.json"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">location of the container hints file</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--containerd string Default: "/run/containerd/containerd.sock"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">containerd endpoint</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--containerd-namespace string Default: "k8s.io"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">containerd namespace</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--context string</td>
|
||||
</tr>
|
||||
@@ -124,6 +159,97 @@ kubectl [flags]
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">Indicates the tolerationSeconds of the toleration for unreachable:NoExecute that is added by default to every pod that does not already have such a toleration.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--disable-root-cgroup-stats</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">Disable collecting root Cgroup stats</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--docker string Default: "unix:///var/run/docker.sock"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">docker endpoint</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--docker-env-metadata-whitelist string</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">a comma-separated list of environment variable keys that needs to be collected for docker containers</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--docker-only</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">Only report docker containers in addition to root stats</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--docker-root string Default: "/var/lib/docker"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">DEPRECATED: docker root is read from docker info (this is a fallback, default: /var/lib/docker)</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--docker-tls</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">use TLS to connect to docker</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--docker-tls-ca string Default: "ca.pem"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">path to trusted CA</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--docker-tls-cert string Default: "cert.pem"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">path to client certificate</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--docker-tls-key string Default: "key.pem"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">path to private key</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--enable-load-reader</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">Whether to enable cpu load reader</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--event-storage-age-limit string Default: "default=0"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">Max length of time for which to store events (per type). Value is a comma separated list of key values, where the keys are event types (e.g.: creation, oom) or "default" and the value is a duration. Default is applied to all non-specified event types</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--event-storage-event-limit string Default: "default=0"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">Max number of events to store (per type). Value is a comma separated list of key values, where the keys are event types (e.g.: creation, oom) or "default" and the value is an integer. Default is applied to all non-specified event types</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--global-housekeeping-interval duration Default: 1m0s</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">Interval between global housekeepings</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">-h, --help</td>
|
||||
</tr>
|
||||
@@ -131,6 +257,13 @@ kubectl [flags]
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">help for kubectl</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--housekeeping-interval duration Default: 10s</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">Interval between container housekeepings</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--insecure-skip-tls-verify</td>
|
||||
</tr>
|
||||
@@ -152,6 +285,13 @@ kubectl [flags]
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">when logging hits line file:N, emit a stack trace</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--log-cadvisor-usage</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">Whether to log the usage of the cAdvisor container</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--log-dir string</td>
|
||||
</tr>
|
||||
@@ -187,6 +327,13 @@ kubectl [flags]
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">log to standard error instead of files</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--machine-id-file string Default: "/etc/machine-id,/var/lib/dbus/machine-id"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">Comma-separated list of files to check for machine-id. Use the first one that exists.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--match-server-version</td>
|
||||
</tr>
|
||||
@@ -257,6 +404,55 @@ kubectl [flags]
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">logs at or above this threshold go to stderr</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--storage-driver-buffer-duration duration Default: 1m0s</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">Writes in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--storage-driver-db string Default: "cadvisor"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">database name</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--storage-driver-host string Default: "localhost:8086"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">database host:port</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--storage-driver-password string Default: "root"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">database password</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--storage-driver-secure</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">use secure connection with database</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--storage-driver-table string Default: "stats"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">table name</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--storage-driver-user string Default: "root"</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">database username</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--token string</td>
|
||||
</tr>
|
||||
@@ -264,6 +460,13 @@ kubectl [flags]
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">Bearer token for authentication to the API server</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--update-machine-info-interval duration Default: 5m0s</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td><td style="line-height: 130%; word-wrap: break-word;">Interval between machine info updates.</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan="2">--user string</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user