Merge branch 'master' into remove_kubectl_run_command_deprecated_en

This commit is contained in:
Cweiping
2020-06-12 15:58:02 +08:00
committed by Weiping Cai
1380 changed files with 16482 additions and 10509 deletions
@@ -4,21 +4,21 @@ reviewers:
- erictune
- krousey
- clove
content_template: templates/concept
content_type: concept
card:
name: reference
weight: 30
---
{{% capture overview %}}
<!-- overview -->
See also: [Kubectl Overview](/docs/reference/kubectl/overview/) and [JsonPath Guide](/docs/reference/kubectl/jsonpath).
This page is an overview of the `kubectl` command.
{{% /capture %}}
{{% capture body %}}
<!-- body -->
# kubectl - Cheat Sheet
@@ -382,9 +382,10 @@ Verbosity | Description
`--v=8` | Display HTTP request contents.
`--v=9` | Display HTTP request contents without truncation of contents.
{{% /capture %}}
{{% capture whatsnext %}}
## {{% heading "whatsnext" %}}
* Learn more about [Overview of kubectl](/docs/reference/kubectl/overview/).
@@ -394,4 +395,4 @@ Verbosity | Description
* See more community [kubectl cheatsheets](https://github.com/dennyzhang/cheatsheet-kubernetes-A4).
{{% /capture %}}
@@ -2,14 +2,14 @@
title: kubectl Usage Conventions
reviewers:
- janetkuo
content_template: templates/concept
content_type: concept
---
{{% capture overview %}}
<!-- overview -->
Recommended usage conventions for `kubectl`.
{{% /capture %}}
{{% capture body %}}
<!-- body -->
## Using `kubectl` in Reusable Scripts
@@ -59,4 +59,4 @@ You can generate the following resources with a kubectl command, `kubectl create
* You can use `kubectl apply` to create or update resources. For more information about using kubectl apply to update resources, see [Kubectl Book](https://kubectl.docs.kubernetes.io).
{{% /capture %}}
@@ -1,16 +1,16 @@
---
title: kubectl for Docker Users
content_template: templates/concept
content_type: concept
reviewers:
- brendandburns
- thockin
---
{{% capture overview %}}
<!-- overview -->
You can use the Kubernetes command line tool kubectl to interact with the API Server. Using kubectl is straightforward if you are familiar with the Docker command line tool. However, there are a few differences between the docker commands and the kubectl commands. The following sections show a docker sub-command and describe the equivalent kubectl command.
{{% /capture %}}
{{% capture body %}}
<!-- body -->
## docker run
To run an nginx Pod and expose the Pod, see [kubectl run](/docs/reference/generated/kubectl/kubectl-commands/#run).
@@ -363,4 +363,4 @@ Grafana is running at https://203.0.113.141/api/v1/namespaces/kube-system/servic
Heapster is running at https://203.0.113.141/api/v1/namespaces/kube-system/services/monitoring-heapster/proxy
InfluxDB is running at https://203.0.113.141/api/v1/namespaces/kube-system/services/monitoring-influxdb/proxy
```
{{% /capture %}}
@@ -1,14 +1,14 @@
---
title: JSONPath Support
content_template: templates/concept
content_type: concept
weight: 25
---
{{% capture overview %}}
<!-- overview -->
Kubectl supports JSONPath template.
{{% /capture %}}
{{% capture body %}}
<!-- body -->
JSONPath template is composed of JSONPath expressions enclosed by curly braces {}.
Kubectl uses JSONPath expressions to filter on specific fields in the JSON object and format the output.
@@ -98,4 +98,4 @@ kubectl get pods -o=jsonpath="{range .items[*]}{.metadata.name}{\"\t\"}{.status.
```
{{< /note >}}
{{% /capture %}}
+10 -7
View File
@@ -1,10 +1,11 @@
---
title: kubectl
content_template: templates/tool-reference
content_type: tool-reference
weight: 30
---
{{% capture synopsis %}}
## {{% heading "synopsis" %}}
kubectl controls the Kubernetes cluster manager.
@@ -15,9 +16,10 @@ kubectl controls the Kubernetes cluster manager.
kubectl [flags]
```
{{% /capture %}}
{{% capture options %}}
## {{% heading "options" %}}
<table style="width: 100%; table-layout: fixed;">
<colgroup>
@@ -521,9 +523,10 @@ kubectl [flags]
{{% /capture %}}
{{% capture seealso %}}
## {{% heading "seealso" %}}
* [kubectl alpha](/docs/reference/generated/kubectl/kubectl-commands#alpha) - Commands for features in alpha
* [kubectl annotate](/docs/reference/generated/kubectl/kubectl-commands#annotate) - Update the annotations on a resource
@@ -569,5 +572,5 @@ kubectl [flags]
* [kubectl version](/docs/reference/generated/kubectl/kubectl-commands#version) - Print the client and server version information
* [kubectl wait](/docs/reference/generated/kubectl/kubectl-commands#wait) - Experimental: Wait for a specific condition on one or many resources.
{{% /capture %}}
+15 -14
View File
@@ -2,21 +2,21 @@
reviewers:
- hw-qiaolei
title: Overview of kubectl
content_template: templates/concept
content_type: concept
weight: 20
card:
name: reference
weight: 20
---
{{% capture overview %}}
<!-- overview -->
Kubectl is a command line tool for controlling Kubernetes clusters. `kubectl` looks for a file named config in the $HOME/.kube directory. You can specify other [kubeconfig](/docs/concepts/configuration/organize-cluster-access-kubeconfig/) files by setting the KUBECONFIG environment variable or by setting the [`--kubeconfig`](/docs/concepts/configuration/organize-cluster-access-kubeconfig/) flag.
This overview covers `kubectl` syntax, describes the command operations, and provides common examples. For details about each command, including all the supported flags and subcommands, see the [kubectl](/docs/reference/generated/kubectl/kubectl-commands/) reference documentation. For installation instructions see [installing kubectl](/docs/tasks/kubectl/install/).
{{% /capture %}}
{{% capture body %}}
<!-- body -->
## Syntax
@@ -32,11 +32,11 @@ where `command`, `TYPE`, `NAME`, and `flags` are:
* `TYPE`: Specifies the [resource type](#resource-types). Resource types are case-insensitive and you can specify the singular, plural, or abbreviated forms. For example, the following commands produce the same output:
```shell
kubectl get pod pod1
kubectl get pods pod1
kubectl get po pod1
```
```shell
kubectl get pod pod1
kubectl get pods pod1
kubectl get po pod1
```
* `NAME`: Specifies the name of the resource. Names are case-sensitive. If the name is omitted, details for all resources are displayed, for example `kubectl get pods`.
@@ -424,7 +424,7 @@ kubectl hello
hello world
```
```
```shell
# we can "uninstall" a plugin, by simply removing it from our PATH
sudo rm /usr/local/bin/kubectl-hello
```
@@ -442,7 +442,7 @@ The following kubectl-compatible plugins are available:
/usr/local/bin/kubectl-foo
/usr/local/bin/kubectl-bar
```
```
```shell
# this command can also warn us about plugins that are
# not executable, or that are overshadowed by other
# plugins, for example
@@ -488,10 +488,11 @@ Current user: plugins-user
To find out more about plugins, take a look at the [example cli plugin](https://github.com/kubernetes/sample-cli-plugin).
{{% /capture %}}
{{% capture whatsnext %}}
## {{% heading "whatsnext" %}}
Start using the [kubectl](/docs/reference/generated/kubectl/kubectl-commands/) commands.
{{% /capture %}}