mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Autogenerate markdown docs for kubectl
Add test to verify generated docs are up to date.
This commit is contained in:
parent
6459b1a1f3
commit
250c948ae7
@ -16,6 +16,7 @@ install:
|
|||||||
script:
|
script:
|
||||||
- KUBE_RACE="-race" KUBE_COVER="-cover -covermode=atomic" KUBE_TIMEOUT='-timeout 60s' ./hack/test-go.sh
|
- KUBE_RACE="-race" KUBE_COVER="-cover -covermode=atomic" KUBE_TIMEOUT='-timeout 60s' ./hack/test-go.sh
|
||||||
- PATH=$HOME/gopath/bin:./third_party/etcd:$PATH ./hack/test-cmd.sh
|
- PATH=$HOME/gopath/bin:./third_party/etcd:$PATH ./hack/test-cmd.sh
|
||||||
|
- PATH=$HOME/gopath/bin:./third_party/etcd:$PATH ./hack/verify-gendocs.sh
|
||||||
- PATH=$HOME/gopath/bin:./third_party/etcd:$PATH ./hack/test-integration.sh
|
- PATH=$HOME/gopath/bin:./third_party/etcd:$PATH ./hack/test-integration.sh
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
|
58
cmd/gendocs/gen_kubectl_docs.go
Normal file
58
cmd/gendocs/gen_kubectl_docs.go
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
/*
|
||||||
|
Copyright 2014 Google Inc. All rights reserved.
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"io"
|
||||||
|
"os"
|
||||||
|
|
||||||
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/kubectl/cmd"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
out := os.Stdout
|
||||||
|
// Set environment variables used by kubectl so the output is consistent,
|
||||||
|
// regardless of where we run.
|
||||||
|
os.Setenv("HOME", "/home/username")
|
||||||
|
kubectl := cmd.NewFactory().NewKubectlCommand(out)
|
||||||
|
fmt.Fprintf(out, "## %s\n\n", kubectl.Name())
|
||||||
|
fmt.Fprintf(out, "%s\n\n", kubectl.Short)
|
||||||
|
fmt.Fprintln(out, "### Commands\n")
|
||||||
|
for _, c := range kubectl.Commands() {
|
||||||
|
genMarkdown(c, nil, out)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func genMarkdown(command, parent *cobra.Command, out io.Writer) {
|
||||||
|
name := command.Name()
|
||||||
|
if parent != nil {
|
||||||
|
name = fmt.Sprintf("%s %s", parent.Name(), name)
|
||||||
|
}
|
||||||
|
fmt.Fprintf(out, "#### %s\n", name)
|
||||||
|
desc := command.Long
|
||||||
|
if len(desc) == 0 {
|
||||||
|
desc = command.Short
|
||||||
|
}
|
||||||
|
fmt.Fprintf(out, "%s\n\n", desc)
|
||||||
|
usage := command.UsageString()
|
||||||
|
fmt.Fprintf(out, "Usage:\n```\n%s\n```\n\n", usage[9:len(usage)-1])
|
||||||
|
for _, c := range command.Commands() {
|
||||||
|
genMarkdown(c, command, out)
|
||||||
|
}
|
||||||
|
}
|
405
docs/cli.md
405
docs/cli.md
@ -1,410 +1,7 @@
|
|||||||
## kubectl
|
## kubectl
|
||||||
The ```kubectl``` command provides command line access to the kubernetes API.
|
The ```kubectl``` command provides command line access to the kubernetes API.
|
||||||
|
|
||||||
### Commands
|
See [kubectl documentation](kubectl.md) for details.
|
||||||
|
|
||||||
#### version
|
|
||||||
Print the version of the client and server.
|
|
||||||
|
|
||||||
Usage:
|
|
||||||
```
|
|
||||||
kubectl version [flags]
|
|
||||||
|
|
||||||
Available Flags:
|
|
||||||
--api-version="v1beta1": The version of the API to use against the server
|
|
||||||
-a, --auth-path="/Users/bburns/.kubernetes_auth": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
|
||||||
--certificate-authority="": Path to a certificate file for the certificate authority
|
|
||||||
-c, --client=false: Client version only (no server required)
|
|
||||||
--client-certificate="": Path to a client certificate for TLS.
|
|
||||||
--client-key="": Path to a client key file for TLS.
|
|
||||||
-h, --help=false: help for version
|
|
||||||
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
|
||||||
--match-server-version=false: Require server version to match client version
|
|
||||||
-n, --namespace="": If present, the namespace scope for this CLI request.
|
|
||||||
--ns-path="/Users/bburns/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
|
||||||
-s, --server="": Kubernetes apiserver to connect to
|
|
||||||
|
|
||||||
|
|
||||||
Use "kubectl help [command]" for more information about that command.
|
|
||||||
```
|
|
||||||
|
|
||||||
#### proxy
|
|
||||||
Create a local proxy to the API server
|
|
||||||
|
|
||||||
Usage:
|
|
||||||
```
|
|
||||||
kubectl proxy [flags]
|
|
||||||
|
|
||||||
Available Flags:
|
|
||||||
--api-version="v1beta1": The API version to use when talking to the server
|
|
||||||
-a, --auth-path="/Users/bburns/.kubernetes_auth": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
|
||||||
--certificate-authority=: Path to a cert. file for the certificate authority.
|
|
||||||
--client-certificate=: Path to a client key file for TLS.
|
|
||||||
--client-key=: Path to a client key file for TLS.
|
|
||||||
-h, --help=false: help for proxy
|
|
||||||
--insecure-skip-tls-verify=%!s(bool=false): If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
|
||||||
--match-server-version=false: Require server version to match client version
|
|
||||||
-n, --namespace="": If present, the namespace scope for this CLI request.
|
|
||||||
--ns-path="/Users/bburns/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
|
||||||
-p, --port=8001: The port on which to run the proxy
|
|
||||||
-s, --server="": The address of the Kubernetes API server
|
|
||||||
--token=: Bearer token for authentication to the API server.
|
|
||||||
--validate=false: If true, use a schema to validate the input before sending it
|
|
||||||
-w, --www="": Also serve static files from the given directory under the prefix /static
|
|
||||||
```
|
|
||||||
|
|
||||||
#### get
|
|
||||||
Display one or more resources
|
|
||||||
Possible resources include pods (po), replication controllers (rc), services
|
|
||||||
(se), minions (mi), or events (ev).
|
|
||||||
|
|
||||||
If you specify a Go template, you can use any fields defined for the API version
|
|
||||||
you are connecting to the server with.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
```sh
|
|
||||||
$ kubectl get pods
|
|
||||||
<list all pods in ps output format>
|
|
||||||
|
|
||||||
$ kubectl get replicationController 1234-56-7890-234234-456456
|
|
||||||
<list single replication controller in ps output format>
|
|
||||||
|
|
||||||
$ kubectl get -o json pod 1234-56-7890-234234-456456
|
|
||||||
<list single pod in json output format>
|
|
||||||
```
|
|
||||||
Usage:
|
|
||||||
```
|
|
||||||
kubectl get [(-o|--output=)json|yaml|...] <resource> [<id>] [flags]
|
|
||||||
|
|
||||||
Available Flags:
|
|
||||||
--api-version="v1beta1": The API version to use when talking to the server
|
|
||||||
-a, --auth-path="/Users/bburns/.kubernetes_auth": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
|
||||||
--certificate-authority=: Path to a cert. file for the certificate authority.
|
|
||||||
--client-certificate=: Path to a client key file for TLS.
|
|
||||||
--client-key=: Path to a client key file for TLS.
|
|
||||||
-h, --help=false: help for get
|
|
||||||
--insecure-skip-tls-verify=%!s(bool=false): If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
|
||||||
--match-server-version=false: Require server version to match client version
|
|
||||||
-n, --namespace="": If present, the namespace scope for this CLI request.
|
|
||||||
--no-headers=false: When using the default output, don't print headers
|
|
||||||
--ns-path="/Users/bburns/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
|
||||||
-o, --output="": Output format: json|yaml|template|templatefile
|
|
||||||
--output-version="": Output the formatted object with the given version (default api-version)
|
|
||||||
-l, --selector="": Selector (label query) to filter on
|
|
||||||
-s, --server="": The address of the Kubernetes API server
|
|
||||||
-t, --template="": Template string or path to template file to use when --output=template or --output=templatefile
|
|
||||||
--token=: Bearer token for authentication to the API server.
|
|
||||||
--validate=false: If true, use a schema to validate the input before sending it
|
|
||||||
-w, --watch=false: After listing/getting the requested object, watch for changes.
|
|
||||||
--watch-only=false: Watch for changes to the requseted object(s), without listing/getting first.
|
|
||||||
```
|
|
||||||
|
|
||||||
#### describe
|
|
||||||
Show details of a specific resource.
|
|
||||||
|
|
||||||
This command joins many API calls together to form a detailed description of a
|
|
||||||
given resource.
|
|
||||||
|
|
||||||
Usage:
|
|
||||||
```
|
|
||||||
kubectl describe <resource> <id> [flags]
|
|
||||||
|
|
||||||
Available Flags:
|
|
||||||
--api-version="v1beta1": The API version to use when talking to the server
|
|
||||||
-a, --auth-path="/Users/bburns/.kubernetes_auth": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
|
||||||
--certificate-authority=: Path to a cert. file for the certificate authority.
|
|
||||||
--client-certificate=: Path to a client key file for TLS.
|
|
||||||
--client-key=: Path to a client key file for TLS.
|
|
||||||
-h, --help=false: help for describe
|
|
||||||
--insecure-skip-tls-verify=%!s(bool=false): If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
|
||||||
--match-server-version=false: Require server version to match client version
|
|
||||||
-n, --namespace="": If present, the namespace scope for this CLI request.
|
|
||||||
--ns-path="/Users/bburns/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
|
||||||
-s, --server="": The address of the Kubernetes API server
|
|
||||||
--token=: Bearer token for authentication to the API server.
|
|
||||||
--validate=false: If true, use a schema to validate the input before sending it
|
|
||||||
```
|
|
||||||
|
|
||||||
### run-container
|
|
||||||
Easily run one or more replicas of an image.
|
|
||||||
|
|
||||||
Creates a replica controller running the specified image, with one or more replicas.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
```sh
|
|
||||||
$ kubectl run-container nginx --image=dockerfile/nginx
|
|
||||||
<starts a single instance of nginx>
|
|
||||||
|
|
||||||
$ kubectl run-container nginx --image=dockerfile/nginx --replicas=5
|
|
||||||
<starts a replicated instance of nginx>
|
|
||||||
|
|
||||||
$ kubectl run-container nginx --image=dockerfile/nginx --dry-run
|
|
||||||
<just print the corresponding API objects, don't actually send them to the apiserver>
|
|
||||||
|
|
||||||
Usage:
|
|
||||||
kubectl run-container <name> --image=<image> [--replicas=replicas] [--dry-run=<bool>] [flags]
|
|
||||||
|
|
||||||
Available Flags:
|
|
||||||
--alsologtostderr=false: log to standard error as well as files
|
|
||||||
--api-version="": The API version to use when talking to the server
|
|
||||||
-a, --auth-path="": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
|
||||||
--certificate-authority="": Path to a cert. file for the certificate authority.
|
|
||||||
--client-certificate="": Path to a client key file for TLS.
|
|
||||||
--client-key="": Path to a client key file for TLS.
|
|
||||||
--cluster="": The name of the kubeconfig cluster to use
|
|
||||||
--context="": The name of the kubeconfig context to use
|
|
||||||
--dry-run=false: If true, only print the object that would be sent, don't actually do anything
|
|
||||||
--generator="run-container-controller-v1": The name of the api generator that you want to use. Default 'run-container-controller-v1'
|
|
||||||
-h, --help=false: help for run-container
|
|
||||||
--image="": The image for the container you wish to run.
|
|
||||||
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
|
||||||
--kubeconfig="": Path to the kubeconfig file to use for CLI requests.
|
|
||||||
-l, --labels="": Labels to apply to the pod(s) created by this call to run.
|
|
||||||
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
|
|
||||||
--log_dir=: If non-empty, write log files in this directory
|
|
||||||
--log_flush_frequency=5s: Maximum number of seconds between log flushes
|
|
||||||
--logtostderr=true: log to standard error instead of files
|
|
||||||
--match-server-version=false: Require server version to match client version
|
|
||||||
-n, --namespace="": If present, the namespace scope for this CLI request.
|
|
||||||
--no-headers=false: When using the default output, don't print headers
|
|
||||||
--ns-path="/Users/bburns/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
|
||||||
-o, --output="": Output format: json|yaml|template|templatefile
|
|
||||||
--output-version="": Output the formatted object with the given version (default api-version)
|
|
||||||
-r, --replicas=1: Number of replicas to create for this container. Default 1
|
|
||||||
-s, --server="": The address of the Kubernetes API server
|
|
||||||
--stderrthreshold=2: logs at or above this threshold go to stderr
|
|
||||||
-t, --template="": Template string or path to template file to use when -o=template or -o=templatefile.
|
|
||||||
--token="": Bearer token for authentication to the API server.
|
|
||||||
--user="": The name of the kubeconfig user to use
|
|
||||||
--v=0: log level for V logs
|
|
||||||
--validate=false: If true, use a schema to validate the input before sending it
|
|
||||||
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging $ kubectl run nginx dockerfile/nginx
|
|
||||||
<starts a single instance of nginx>
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
#### create
|
|
||||||
Create a resource by filename or stdin.
|
|
||||||
|
|
||||||
JSON and YAML formats are accepted.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
```sh
|
|
||||||
$ kubectl create -f pod.json
|
|
||||||
<create a pod using the data in pod.json>
|
|
||||||
|
|
||||||
$ cat pod.json | kubectl create -f -
|
|
||||||
<create a pod based on the json passed into stdin>
|
|
||||||
```
|
|
||||||
Usage:
|
|
||||||
```
|
|
||||||
kubectl create -f filename [flags]
|
|
||||||
|
|
||||||
Available Flags:
|
|
||||||
--api-version="v1beta1": The API version to use when talking to the server
|
|
||||||
-a, --auth-path="/Users/bburns/.kubernetes_auth": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
|
||||||
--certificate-authority=: Path to a cert. file for the certificate authority.
|
|
||||||
--client-certificate=: Path to a client key file for TLS.
|
|
||||||
--client-key=: Path to a client key file for TLS.
|
|
||||||
-f, --filename="": Filename or URL to file to use to create the resource
|
|
||||||
-h, --help=false: help for create
|
|
||||||
--insecure-skip-tls-verify=%!s(bool=false): If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
|
||||||
--match-server-version=false: Require server version to match client version
|
|
||||||
-n, --namespace="": If present, the namespace scope for this CLI request.
|
|
||||||
--ns-path="/Users/bburns/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
|
||||||
-s, --server="": The address of the Kubernetes API server
|
|
||||||
--token=: Bearer token for authentication to the API server.
|
|
||||||
--validate=false: If true, use a schema to validate the input before sending it
|
|
||||||
```
|
|
||||||
|
|
||||||
#### createall
|
|
||||||
Create all resources contained in JSON file specified in a directory, filename or stdin
|
|
||||||
|
|
||||||
JSON and YAML formats are accepted.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
```sh
|
|
||||||
$ kubectl createall -d configs/
|
|
||||||
<creates all resources listed in JSON or YAML files, found recursively under the configs directory>
|
|
||||||
|
|
||||||
$ kubectl createall -f config.json
|
|
||||||
<creates all resources listed in config.json>
|
|
||||||
|
|
||||||
$ cat config.json | kubectl apply -f -
|
|
||||||
<creates all resources listed in config.json>
|
|
||||||
```
|
|
||||||
Usage:
|
|
||||||
```
|
|
||||||
kubectl createall [-d directory] [-f filename] [flags]
|
|
||||||
|
|
||||||
Available Flags:
|
|
||||||
--api-version="v1beta1": The API version to use when talking to the server
|
|
||||||
-a, --auth-path="/Users/bburns/.kubernetes_auth": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
|
||||||
--certificate-authority=: Path to a cert. file for the certificate authority.
|
|
||||||
--client-certificate=: Path to a client key file for TLS.
|
|
||||||
--client-key=: Path to a client key file for TLS.
|
|
||||||
-d, --directory="": Directory of JSON or YAML files to use to update the resource
|
|
||||||
-f, --filename="": Filename or URL to file to use to update the resource
|
|
||||||
-h, --help=false: help for createall
|
|
||||||
--insecure-skip-tls-verify=%!s(bool=false): If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
|
||||||
--match-server-version=false: Require server version to match client version
|
|
||||||
-n, --namespace="": If present, the namespace scope for this CLI request.
|
|
||||||
--ns-path="/Users/bburns/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
|
||||||
-s, --server="": The address of the Kubernetes API server
|
|
||||||
--token=: Bearer token for authentication to the API server.
|
|
||||||
--validate=false: If true, use a schema to validate the input before sending it
|
|
||||||
```
|
|
||||||
|
|
||||||
#### update
|
|
||||||
Update a resource by filename or stdin.
|
|
||||||
|
|
||||||
JSON and YAML formats are accepted.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
```sh
|
|
||||||
$ kubectl update -f pod.json
|
|
||||||
<update a pod using the data in pod.json>
|
|
||||||
|
|
||||||
$ cat pod.json | kubectl update -f -
|
|
||||||
<update a pod based on the json passed into stdin>
|
|
||||||
```
|
|
||||||
|
|
||||||
Usage:
|
|
||||||
```
|
|
||||||
kubectl update -f filename [flags]
|
|
||||||
|
|
||||||
Available Flags:
|
|
||||||
--api-version="v1beta1": The API version to use when talking to the server
|
|
||||||
-a, --auth-path="/Users/bburns/.kubernetes_auth": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
|
||||||
--certificate-authority=: Path to a cert. file for the certificate authority.
|
|
||||||
--client-certificate=: Path to a client key file for TLS.
|
|
||||||
--client-key=: Path to a client key file for TLS.
|
|
||||||
-f, --filename="": Filename or URL to file to use to update the resource
|
|
||||||
-h, --help=false: help for update
|
|
||||||
--insecure-skip-tls-verify=%!s(bool=false): If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
|
||||||
--match-server-version=false: Require server version to match client version
|
|
||||||
-n, --namespace="": If present, the namespace scope for this CLI request.
|
|
||||||
--ns-path="/Users/bburns/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
|
||||||
-s, --server="": The address of the Kubernetes API server
|
|
||||||
--token=: Bearer token for authentication to the API server.
|
|
||||||
--validate=false: If true, use a schema to validate the input before sending it
|
|
||||||
```
|
|
||||||
|
|
||||||
#### delete
|
|
||||||
Delete a resource by filename, stdin, resource and id or by resources and label selector.
|
|
||||||
|
|
||||||
JSON and YAML formats are accepted.
|
|
||||||
|
|
||||||
If both a filename and command line arguments are passed, the command line
|
|
||||||
arguments are used and the filename is ignored.
|
|
||||||
|
|
||||||
Note that the delete command does NOT do resource version checks, so if someone
|
|
||||||
submits an update to a resource right when you submit a delete, their update
|
|
||||||
will be lost along with the rest of the resource.
|
|
||||||
|
|
||||||
Examples:
|
|
||||||
```sh
|
|
||||||
$ kubectl delete -f pod.json
|
|
||||||
<delete a pod using the type and id pod.json>
|
|
||||||
|
|
||||||
$ cat pod.json | kubectl delete -f -
|
|
||||||
<delete a pod based on the type and id in the json passed into stdin>
|
|
||||||
|
|
||||||
$ kubectl delete pods,services -l name=myLabel
|
|
||||||
<delete pods and services with label name=myLabel>
|
|
||||||
|
|
||||||
$ kubectl delete pod 1234-56-7890-234234-456456
|
|
||||||
<delete a pod with ID 1234-56-7890-234234-456456>
|
|
||||||
```
|
|
||||||
|
|
||||||
Usage:
|
|
||||||
```
|
|
||||||
kubectl delete ([-f filename] | (<resource> [(<id> | -l <label>)] [flags]
|
|
||||||
|
|
||||||
Available Flags:
|
|
||||||
--api-version="v1beta1": The API version to use when talking to the server
|
|
||||||
-a, --auth-path="/Users/bburns/.kubernetes_auth": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
|
||||||
--certificate-authority=: Path to a cert. file for the certificate authority.
|
|
||||||
--client-certificate=: Path to a client key file for TLS.
|
|
||||||
--client-key=: Path to a client key file for TLS.
|
|
||||||
-f, --filename="": Filename or URL to file to use to delete the resource
|
|
||||||
-h, --help=false: help for delete
|
|
||||||
--insecure-skip-tls-verify=%!s(bool=false): If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
|
||||||
--match-server-version=false: Require server version to match client version
|
|
||||||
-n, --namespace="": If present, the namespace scope for this CLI request.
|
|
||||||
--ns-path="/Users/bburns/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
|
||||||
-l, --selector="": Selector (label query) to filter on
|
|
||||||
-s, --server="": The address of the Kubernetes API server
|
|
||||||
--token=: Bearer token for authentication to the API server.
|
|
||||||
--validate=false: If true, use a schema to validate the input before sending it
|
|
||||||
```
|
|
||||||
|
|
||||||
#### logs
|
|
||||||
Print the logs for a container in a pod. If the pod has only one container, the container name is optional
|
|
||||||
Examples:
|
|
||||||
```sh
|
|
||||||
$ kubectl log 123456-7890 ruby-container
|
|
||||||
<returns snapshot of ruby-container logs from pod 123456-7890>
|
|
||||||
|
|
||||||
$ kubectl log -f 123456-7890 ruby-container
|
|
||||||
<starts streaming of ruby-container logs from pod 123456-7890>
|
|
||||||
```
|
|
||||||
Usage:
|
|
||||||
```
|
|
||||||
kubectl log [-f] <pod> [<container>] [flags]
|
|
||||||
|
|
||||||
Available Flags:
|
|
||||||
--api-version="v1beta1": The API version to use when talking to the server
|
|
||||||
-a, --auth-path="/Users/bburns/.kubernetes_auth": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
|
||||||
--certificate-authority=: Path to a cert. file for the certificate authority.
|
|
||||||
--client-certificate=: Path to a client key file for TLS.
|
|
||||||
--client-key=: Path to a client key file for TLS.
|
|
||||||
-f, --follow=false: Specify if the logs should be streamed.
|
|
||||||
-h, --help=false: help for log
|
|
||||||
--insecure-skip-tls-verify=%!s(bool=false): If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
|
||||||
--match-server-version=false: Require server version to match client version
|
|
||||||
-n, --namespace="": If present, the namespace scope for this CLI request.
|
|
||||||
--ns-path="/Users/bburns/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
|
||||||
-s, --server="": The address of the Kubernetes API server
|
|
||||||
--token=: Bearer token for authentication to the API server.
|
|
||||||
--validate=false: If true, use a schema to validate the input before sending it
|
|
||||||
```
|
|
||||||
|
|
||||||
### Usage
|
|
||||||
```
|
|
||||||
Usage:
|
|
||||||
kubectl [flags]
|
|
||||||
kubectl [command]
|
|
||||||
|
|
||||||
Available Commands:
|
|
||||||
version Print version of client and server
|
|
||||||
proxy Run a proxy to the Kubernetes API server
|
|
||||||
get [(-o|--output=)json|yaml|...] <resource> [<id>] Display one or many resources
|
|
||||||
describe <resource> <id> Show details of a specific resource
|
|
||||||
create -f filename Create a resource by filename or stdin
|
|
||||||
createall [-d directory] [-f filename] Create all resources specified in a directory, filename or stdin
|
|
||||||
update -f filename Update a resource by filename or stdin
|
|
||||||
delete ([-f filename] | (<resource> [(<id> | -l <label>)] Delete a resource by filename, stdin or resource and id
|
|
||||||
namespace [<namespace>] Set and view the current Kubernetes namespace
|
|
||||||
log [-f] <pod> [<container>] Print the logs for a container in a pod.
|
|
||||||
help [command] Help about any command
|
|
||||||
|
|
||||||
Available Flags:
|
|
||||||
--api-version="v1beta1": The API version to use when talking to the server
|
|
||||||
-a, --auth-path="/Users/bburns/.kubernetes_auth": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
|
||||||
--certificate-authority=: Path to a cert. file for the certificate authority.
|
|
||||||
--client-certificate=: Path to a client key file for TLS.
|
|
||||||
--client-key=: Path to a client key file for TLS.
|
|
||||||
-h, --help=false: help for kubectl
|
|
||||||
--insecure-skip-tls-verify=%!s(bool=false): If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
|
||||||
--match-server-version=false: Require server version to match client version
|
|
||||||
-n, --namespace="": If present, the namespace scope for this CLI request.
|
|
||||||
--ns-path="/Users/bburns/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
|
||||||
-s, --server="": The address of the Kubernetes API server
|
|
||||||
--token=: Bearer token for authentication to the API server.
|
|
||||||
--validate=false: If true, use a schema to validate the input before sending it
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## kubecfg is deprecated. Please use kubectl!
|
## kubecfg is deprecated. Please use kubectl!
|
||||||
## kubecfg command line interface
|
## kubecfg command line interface
|
||||||
|
873
docs/kubectl.md
Normal file
873
docs/kubectl.md
Normal file
@ -0,0 +1,873 @@
|
|||||||
|
## kubectl
|
||||||
|
|
||||||
|
kubectl controls the Kubernetes cluster manager
|
||||||
|
|
||||||
|
### Commands
|
||||||
|
|
||||||
|
#### version
|
||||||
|
Print version of client and server
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
```
|
||||||
|
kubectl version [flags]
|
||||||
|
|
||||||
|
Available Flags:
|
||||||
|
--alsologtostderr=false: log to standard error as well as files
|
||||||
|
--api-version="": The API version to use when talking to the server
|
||||||
|
-a, --auth-path="": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
||||||
|
--certificate-authority="": Path to a cert. file for the certificate authority.
|
||||||
|
-c, --client=false: Client version only (no server required)
|
||||||
|
--client-certificate="": Path to a client key file for TLS.
|
||||||
|
--client-key="": Path to a client key file for TLS.
|
||||||
|
--cluster="": The name of the kubeconfig cluster to use
|
||||||
|
--context="": The name of the kubeconfig context to use
|
||||||
|
-h, --help=false: help for version
|
||||||
|
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
||||||
|
--kubeconfig="": Path to the kubeconfig file to use for CLI requests.
|
||||||
|
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
|
||||||
|
--log_dir=: If non-empty, write log files in this directory
|
||||||
|
--log_flush_frequency=5s: Maximum number of seconds between log flushes
|
||||||
|
--logtostderr=true: log to standard error instead of files
|
||||||
|
--match-server-version=false: Require server version to match client version
|
||||||
|
-n, --namespace="": If present, the namespace scope for this CLI request.
|
||||||
|
--ns-path="/home/username/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
||||||
|
-s, --server="": The address of the Kubernetes API server
|
||||||
|
--stderrthreshold=2: logs at or above this threshold go to stderr
|
||||||
|
--token="": Bearer token for authentication to the API server.
|
||||||
|
--user="": The name of the kubeconfig user to use
|
||||||
|
--v=0: log level for V logs
|
||||||
|
--validate=false: If true, use a schema to validate the input before sending it
|
||||||
|
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### proxy
|
||||||
|
Run a proxy to the Kubernetes API server.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
```
|
||||||
|
kubectl proxy [flags]
|
||||||
|
|
||||||
|
Available Flags:
|
||||||
|
--alsologtostderr=false: log to standard error as well as files
|
||||||
|
--api-version="": The API version to use when talking to the server
|
||||||
|
-a, --auth-path="": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
||||||
|
--certificate-authority="": Path to a cert. file for the certificate authority.
|
||||||
|
--client-certificate="": Path to a client key file for TLS.
|
||||||
|
--client-key="": Path to a client key file for TLS.
|
||||||
|
--cluster="": The name of the kubeconfig cluster to use
|
||||||
|
--context="": The name of the kubeconfig context to use
|
||||||
|
-h, --help=false: help for proxy
|
||||||
|
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
||||||
|
--kubeconfig="": Path to the kubeconfig file to use for CLI requests.
|
||||||
|
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
|
||||||
|
--log_dir=: If non-empty, write log files in this directory
|
||||||
|
--log_flush_frequency=5s: Maximum number of seconds between log flushes
|
||||||
|
--logtostderr=true: log to standard error instead of files
|
||||||
|
--match-server-version=false: Require server version to match client version
|
||||||
|
-n, --namespace="": If present, the namespace scope for this CLI request.
|
||||||
|
--ns-path="/home/username/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
||||||
|
-p, --port=8001: The port on which to run the proxy
|
||||||
|
-s, --server="": The address of the Kubernetes API server
|
||||||
|
--stderrthreshold=2: logs at or above this threshold go to stderr
|
||||||
|
--token="": Bearer token for authentication to the API server.
|
||||||
|
--user="": The name of the kubeconfig user to use
|
||||||
|
--v=0: log level for V logs
|
||||||
|
--validate=false: If true, use a schema to validate the input before sending it
|
||||||
|
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
|
||||||
|
-w, --www="": Also serve static files from the given directory under the prefix /static
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### get
|
||||||
|
Display one or many resources.
|
||||||
|
|
||||||
|
Possible resources include pods (po), replication controllers (rc), services
|
||||||
|
(se), minions (mi), or events (ev).
|
||||||
|
|
||||||
|
If you specify a Go template, you can use any fields defined for the API version
|
||||||
|
you are connecting to the server with.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
$ kubectl get pods
|
||||||
|
<list all pods in ps output format>
|
||||||
|
|
||||||
|
$ kubectl get replicationController 1234-56-7890-234234-456456
|
||||||
|
<list single replication controller in ps output format>
|
||||||
|
|
||||||
|
$ kubectl get -o json pod 1234-56-7890-234234-456456
|
||||||
|
<list single pod in json output format>
|
||||||
|
|
||||||
|
$ kubectl get rc,services
|
||||||
|
<list replication controllers and services together in ps output format>
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
```
|
||||||
|
kubectl get [(-o|--output=)json|yaml|...] <resource> [<id>] [flags]
|
||||||
|
|
||||||
|
Available Flags:
|
||||||
|
--alsologtostderr=false: log to standard error as well as files
|
||||||
|
--api-version="": The API version to use when talking to the server
|
||||||
|
-a, --auth-path="": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
||||||
|
--certificate-authority="": Path to a cert. file for the certificate authority.
|
||||||
|
--client-certificate="": Path to a client key file for TLS.
|
||||||
|
--client-key="": Path to a client key file for TLS.
|
||||||
|
--cluster="": The name of the kubeconfig cluster to use
|
||||||
|
--context="": The name of the kubeconfig context to use
|
||||||
|
-h, --help=false: help for get
|
||||||
|
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
||||||
|
--kubeconfig="": Path to the kubeconfig file to use for CLI requests.
|
||||||
|
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
|
||||||
|
--log_dir=: If non-empty, write log files in this directory
|
||||||
|
--log_flush_frequency=5s: Maximum number of seconds between log flushes
|
||||||
|
--logtostderr=true: log to standard error instead of files
|
||||||
|
--match-server-version=false: Require server version to match client version
|
||||||
|
-n, --namespace="": If present, the namespace scope for this CLI request.
|
||||||
|
--no-headers=false: When using the default output, don't print headers
|
||||||
|
--ns-path="/home/username/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
||||||
|
-o, --output="": Output format: json|yaml|template|templatefile
|
||||||
|
--output-version="": Output the formatted object with the given version (default api-version)
|
||||||
|
-l, --selector="": Selector (label query) to filter on
|
||||||
|
-s, --server="": The address of the Kubernetes API server
|
||||||
|
--stderrthreshold=2: logs at or above this threshold go to stderr
|
||||||
|
-t, --template="": Template string or path to template file to use when -o=template or -o=templatefile.
|
||||||
|
--token="": Bearer token for authentication to the API server.
|
||||||
|
--user="": The name of the kubeconfig user to use
|
||||||
|
--v=0: log level for V logs
|
||||||
|
--validate=false: If true, use a schema to validate the input before sending it
|
||||||
|
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
|
||||||
|
-w, --watch=false: After listing/getting the requested object, watch for changes.
|
||||||
|
--watch-only=false: Watch for changes to the requseted object(s), without listing/getting first.
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### describe
|
||||||
|
Show details of a specific resource.
|
||||||
|
|
||||||
|
This command joins many API calls together to form a detailed description of a
|
||||||
|
given resource.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
```
|
||||||
|
kubectl describe <resource> <id> [flags]
|
||||||
|
|
||||||
|
Available Flags:
|
||||||
|
--alsologtostderr=false: log to standard error as well as files
|
||||||
|
--api-version="": The API version to use when talking to the server
|
||||||
|
-a, --auth-path="": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
||||||
|
--certificate-authority="": Path to a cert. file for the certificate authority.
|
||||||
|
--client-certificate="": Path to a client key file for TLS.
|
||||||
|
--client-key="": Path to a client key file for TLS.
|
||||||
|
--cluster="": The name of the kubeconfig cluster to use
|
||||||
|
--context="": The name of the kubeconfig context to use
|
||||||
|
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
||||||
|
--kubeconfig="": Path to the kubeconfig file to use for CLI requests.
|
||||||
|
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
|
||||||
|
--log_dir=: If non-empty, write log files in this directory
|
||||||
|
--log_flush_frequency=5s: Maximum number of seconds between log flushes
|
||||||
|
--logtostderr=true: log to standard error instead of files
|
||||||
|
--match-server-version=false: Require server version to match client version
|
||||||
|
-n, --namespace="": If present, the namespace scope for this CLI request.
|
||||||
|
--ns-path="/home/username/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
||||||
|
-s, --server="": The address of the Kubernetes API server
|
||||||
|
--stderrthreshold=2: logs at or above this threshold go to stderr
|
||||||
|
--token="": Bearer token for authentication to the API server.
|
||||||
|
--user="": The name of the kubeconfig user to use
|
||||||
|
--v=0: log level for V logs
|
||||||
|
--validate=false: If true, use a schema to validate the input before sending it
|
||||||
|
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### create
|
||||||
|
Create a resource by filename or stdin.
|
||||||
|
|
||||||
|
JSON and YAML formats are accepted.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
$ kubectl create -f pod.json
|
||||||
|
<create a pod using the data in pod.json>
|
||||||
|
|
||||||
|
$ cat pod.json | kubectl create -f -
|
||||||
|
<create a pod based on the json passed into stdin>
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
```
|
||||||
|
kubectl create -f filename [flags]
|
||||||
|
|
||||||
|
Available Flags:
|
||||||
|
--alsologtostderr=false: log to standard error as well as files
|
||||||
|
--api-version="": The API version to use when talking to the server
|
||||||
|
-a, --auth-path="": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
||||||
|
--certificate-authority="": Path to a cert. file for the certificate authority.
|
||||||
|
--client-certificate="": Path to a client key file for TLS.
|
||||||
|
--client-key="": Path to a client key file for TLS.
|
||||||
|
--cluster="": The name of the kubeconfig cluster to use
|
||||||
|
--context="": The name of the kubeconfig context to use
|
||||||
|
-f, --filename=[]: Filename, directory, or URL to file to use to create the resource
|
||||||
|
-h, --help=false: help for create
|
||||||
|
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
||||||
|
--kubeconfig="": Path to the kubeconfig file to use for CLI requests.
|
||||||
|
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
|
||||||
|
--log_dir=: If non-empty, write log files in this directory
|
||||||
|
--log_flush_frequency=5s: Maximum number of seconds between log flushes
|
||||||
|
--logtostderr=true: log to standard error instead of files
|
||||||
|
--match-server-version=false: Require server version to match client version
|
||||||
|
-n, --namespace="": If present, the namespace scope for this CLI request.
|
||||||
|
--ns-path="/home/username/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
||||||
|
-s, --server="": The address of the Kubernetes API server
|
||||||
|
--stderrthreshold=2: logs at or above this threshold go to stderr
|
||||||
|
--token="": Bearer token for authentication to the API server.
|
||||||
|
--user="": The name of the kubeconfig user to use
|
||||||
|
--v=0: log level for V logs
|
||||||
|
--validate=false: If true, use a schema to validate the input before sending it
|
||||||
|
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### update
|
||||||
|
Update a resource by filename or stdin.
|
||||||
|
|
||||||
|
JSON and YAML formats are accepted.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
$ kubectl update -f pod.json
|
||||||
|
<update a pod using the data in pod.json>
|
||||||
|
|
||||||
|
$ cat pod.json | kubectl update -f -
|
||||||
|
<update a pod based on the json passed into stdin>
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
```
|
||||||
|
kubectl update -f filename [flags]
|
||||||
|
|
||||||
|
Available Flags:
|
||||||
|
--alsologtostderr=false: log to standard error as well as files
|
||||||
|
--api-version="": The API version to use when talking to the server
|
||||||
|
-a, --auth-path="": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
||||||
|
--certificate-authority="": Path to a cert. file for the certificate authority.
|
||||||
|
--client-certificate="": Path to a client key file for TLS.
|
||||||
|
--client-key="": Path to a client key file for TLS.
|
||||||
|
--cluster="": The name of the kubeconfig cluster to use
|
||||||
|
--context="": The name of the kubeconfig context to use
|
||||||
|
-f, --filename="": Filename or URL to file to use to update the resource
|
||||||
|
-h, --help=false: help for update
|
||||||
|
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
||||||
|
--kubeconfig="": Path to the kubeconfig file to use for CLI requests.
|
||||||
|
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
|
||||||
|
--log_dir=: If non-empty, write log files in this directory
|
||||||
|
--log_flush_frequency=5s: Maximum number of seconds between log flushes
|
||||||
|
--logtostderr=true: log to standard error instead of files
|
||||||
|
--match-server-version=false: Require server version to match client version
|
||||||
|
-n, --namespace="": If present, the namespace scope for this CLI request.
|
||||||
|
--ns-path="/home/username/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
||||||
|
-s, --server="": The address of the Kubernetes API server
|
||||||
|
--stderrthreshold=2: logs at or above this threshold go to stderr
|
||||||
|
--token="": Bearer token for authentication to the API server.
|
||||||
|
--user="": The name of the kubeconfig user to use
|
||||||
|
--v=0: log level for V logs
|
||||||
|
--validate=false: If true, use a schema to validate the input before sending it
|
||||||
|
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### delete
|
||||||
|
Delete a resource by filename, stdin, resource and id or by resources and label selector.
|
||||||
|
|
||||||
|
JSON and YAML formats are accepted.
|
||||||
|
|
||||||
|
If both a filename and command line arguments are passed, the command line
|
||||||
|
arguments are used and the filename is ignored.
|
||||||
|
|
||||||
|
Note that the delete command does NOT do resource version checks, so if someone
|
||||||
|
submits an update to a resource right when you submit a delete, their update
|
||||||
|
will be lost along with the rest of the resource.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
$ kubectl delete -f pod.json
|
||||||
|
<delete a pod using the type and id pod.json>
|
||||||
|
|
||||||
|
$ cat pod.json | kubectl delete -f -
|
||||||
|
<delete a pod based on the type and id in the json passed into stdin>
|
||||||
|
|
||||||
|
$ kubectl delete pods,services -l name=myLabel
|
||||||
|
<delete pods and services with label name=myLabel>
|
||||||
|
|
||||||
|
$ kubectl delete pod 1234-56-7890-234234-456456
|
||||||
|
<delete a pod with ID 1234-56-7890-234234-456456>
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
```
|
||||||
|
kubectl delete ([-f filename] | (<resource> [(<id> | -l <label>)] [flags]
|
||||||
|
|
||||||
|
Available Flags:
|
||||||
|
--alsologtostderr=false: log to standard error as well as files
|
||||||
|
--api-version="": The API version to use when talking to the server
|
||||||
|
-a, --auth-path="": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
||||||
|
--certificate-authority="": Path to a cert. file for the certificate authority.
|
||||||
|
--client-certificate="": Path to a client key file for TLS.
|
||||||
|
--client-key="": Path to a client key file for TLS.
|
||||||
|
--cluster="": The name of the kubeconfig cluster to use
|
||||||
|
--context="": The name of the kubeconfig context to use
|
||||||
|
-f, --filename=[]: Filename, directory, or URL to a file containing the resource to delete
|
||||||
|
-h, --help=false: help for delete
|
||||||
|
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
||||||
|
--kubeconfig="": Path to the kubeconfig file to use for CLI requests.
|
||||||
|
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
|
||||||
|
--log_dir=: If non-empty, write log files in this directory
|
||||||
|
--log_flush_frequency=5s: Maximum number of seconds between log flushes
|
||||||
|
--logtostderr=true: log to standard error instead of files
|
||||||
|
--match-server-version=false: Require server version to match client version
|
||||||
|
-n, --namespace="": If present, the namespace scope for this CLI request.
|
||||||
|
--ns-path="/home/username/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
||||||
|
-l, --selector="": Selector (label query) to filter on
|
||||||
|
-s, --server="": The address of the Kubernetes API server
|
||||||
|
--stderrthreshold=2: logs at or above this threshold go to stderr
|
||||||
|
--token="": Bearer token for authentication to the API server.
|
||||||
|
--user="": The name of the kubeconfig user to use
|
||||||
|
--v=0: log level for V logs
|
||||||
|
--validate=false: If true, use a schema to validate the input before sending it
|
||||||
|
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### config
|
||||||
|
config modifies .kubeconfig files using subcommands like "kubectl config set current-context my-context"
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
```
|
||||||
|
kubectl config <subcommand> [flags]
|
||||||
|
kubectl config [command]
|
||||||
|
|
||||||
|
Available Commands:
|
||||||
|
view displays the specified .kubeconfig file or a merged result
|
||||||
|
set-cluster name [server] [insecure-skip-tls-verify] [certificate-authority] [api-version] Sets a cluster entry in .kubeconfig
|
||||||
|
set-credentials name Sets a user entry in .kubeconfig
|
||||||
|
set-context name Sets a context entry in .kubeconfig
|
||||||
|
set property-name property-value Sets an individual value in a .kubeconfig file
|
||||||
|
unset property-name Unsets an individual value in a .kubeconfig file
|
||||||
|
use-context context-name Sets the current-context in a .kubeconfig file
|
||||||
|
|
||||||
|
Available Flags:
|
||||||
|
--alsologtostderr=false: log to standard error as well as files
|
||||||
|
--api-version="": The API version to use when talking to the server
|
||||||
|
-a, --auth-path="": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
||||||
|
--certificate-authority="": Path to a cert. file for the certificate authority.
|
||||||
|
--client-certificate="": Path to a client key file for TLS.
|
||||||
|
--client-key="": Path to a client key file for TLS.
|
||||||
|
--cluster="": The name of the kubeconfig cluster to use
|
||||||
|
--context="": The name of the kubeconfig context to use
|
||||||
|
--global=false: use the .kubeconfig from /home/username
|
||||||
|
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
||||||
|
--kubeconfig="": use a particular .kubeconfig file
|
||||||
|
--local=true: use the .kubeconfig in the currect directory
|
||||||
|
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
|
||||||
|
--log_dir=: If non-empty, write log files in this directory
|
||||||
|
--log_flush_frequency=5s: Maximum number of seconds between log flushes
|
||||||
|
--logtostderr=true: log to standard error instead of files
|
||||||
|
--match-server-version=false: Require server version to match client version
|
||||||
|
-n, --namespace="": If present, the namespace scope for this CLI request.
|
||||||
|
--ns-path="/home/username/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
||||||
|
-s, --server="": The address of the Kubernetes API server
|
||||||
|
--stderrthreshold=2: logs at or above this threshold go to stderr
|
||||||
|
--token="": Bearer token for authentication to the API server.
|
||||||
|
--user="": The name of the kubeconfig user to use
|
||||||
|
--v=0: log level for V logs
|
||||||
|
--validate=false: If true, use a schema to validate the input before sending it
|
||||||
|
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
|
||||||
|
|
||||||
|
Additional help topics:
|
||||||
|
kubectl version Print version of client and server
|
||||||
|
kubectl proxy Run a proxy to the Kubernetes API server
|
||||||
|
kubectl get Display one or many resources
|
||||||
|
kubectl describe Show details of a specific resource
|
||||||
|
kubectl create Create a resource by filename or stdin
|
||||||
|
kubectl update Update a resource by filename or stdin
|
||||||
|
kubectl delete Delete a resource by filename, stdin or resource and id
|
||||||
|
kubectl config config modifies .kubeconfig files
|
||||||
|
kubectl namespace Set and view the current Kubernetes namespace
|
||||||
|
kubectl log Print the logs for a container in a pod.
|
||||||
|
kubectl rollingupdate Perform a rolling update of the given ReplicationController
|
||||||
|
kubectl run-container Run a particular image on the cluster.
|
||||||
|
|
||||||
|
Use "kubectl help [command]" for more information about that command.
|
||||||
|
```
|
||||||
|
|
||||||
|
#### config view
|
||||||
|
displays the specified .kubeconfig file or a merged result
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
```
|
||||||
|
kubectl config view [flags]
|
||||||
|
|
||||||
|
Available Flags:
|
||||||
|
--alsologtostderr=false: log to standard error as well as files
|
||||||
|
--api-version="": The API version to use when talking to the server
|
||||||
|
-a, --auth-path="": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
||||||
|
--certificate-authority="": Path to a cert. file for the certificate authority.
|
||||||
|
--client-certificate="": Path to a client key file for TLS.
|
||||||
|
--client-key="": Path to a client key file for TLS.
|
||||||
|
--cluster="": The name of the kubeconfig cluster to use
|
||||||
|
--context="": The name of the kubeconfig context to use
|
||||||
|
--global=false: use the .kubeconfig from /home/username
|
||||||
|
-h, --help=false: help for view
|
||||||
|
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
||||||
|
--kubeconfig="": use a particular .kubeconfig file
|
||||||
|
--local=true: use the .kubeconfig in the currect directory
|
||||||
|
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
|
||||||
|
--log_dir=: If non-empty, write log files in this directory
|
||||||
|
--log_flush_frequency=5s: Maximum number of seconds between log flushes
|
||||||
|
--logtostderr=true: log to standard error instead of files
|
||||||
|
--match-server-version=false: Require server version to match client version
|
||||||
|
--merge=false: merge together the full hierarchy of .kubeconfig files
|
||||||
|
-n, --namespace="": If present, the namespace scope for this CLI request.
|
||||||
|
--ns-path="/home/username/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
||||||
|
-s, --server="": The address of the Kubernetes API server
|
||||||
|
--stderrthreshold=2: logs at or above this threshold go to stderr
|
||||||
|
--token="": Bearer token for authentication to the API server.
|
||||||
|
--user="": The name of the kubeconfig user to use
|
||||||
|
--v=0: log level for V logs
|
||||||
|
--validate=false: If true, use a schema to validate the input before sending it
|
||||||
|
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### config set-cluster
|
||||||
|
Sets a cluster entry in .kubeconfig
|
||||||
|
|
||||||
|
Specifying a name that already exists overwrites that cluster entry.
|
||||||
|
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
```
|
||||||
|
kubectl config set-cluster name [server] [insecure-skip-tls-verify] [certificate-authority] [api-version] [flags]
|
||||||
|
|
||||||
|
Available Flags:
|
||||||
|
--alsologtostderr=false: log to standard error as well as files
|
||||||
|
--api-version="": api-version for the cluster entry in .kubeconfig
|
||||||
|
-a, --auth-path="": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
||||||
|
--certificate-authority="": certificate-authority for the cluster entry in .kubeconfig
|
||||||
|
--client-certificate="": Path to a client key file for TLS.
|
||||||
|
--client-key="": Path to a client key file for TLS.
|
||||||
|
--cluster="": The name of the kubeconfig cluster to use
|
||||||
|
--context="": The name of the kubeconfig context to use
|
||||||
|
--global=false: use the .kubeconfig from /home/username
|
||||||
|
-h, --help=false: help for set-cluster
|
||||||
|
--insecure-skip-tls-verify=false: insecure-skip-tls-verify for the cluster entry in .kubeconfig
|
||||||
|
--kubeconfig="": use a particular .kubeconfig file
|
||||||
|
--local=true: use the .kubeconfig in the currect directory
|
||||||
|
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
|
||||||
|
--log_dir=: If non-empty, write log files in this directory
|
||||||
|
--log_flush_frequency=5s: Maximum number of seconds between log flushes
|
||||||
|
--logtostderr=true: log to standard error instead of files
|
||||||
|
--match-server-version=false: Require server version to match client version
|
||||||
|
-n, --namespace="": If present, the namespace scope for this CLI request.
|
||||||
|
--ns-path="/home/username/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
||||||
|
--server="": server for the cluster entry in .kubeconfig
|
||||||
|
--stderrthreshold=2: logs at or above this threshold go to stderr
|
||||||
|
--token="": Bearer token for authentication to the API server.
|
||||||
|
--user="": The name of the kubeconfig user to use
|
||||||
|
--v=0: log level for V logs
|
||||||
|
--validate=false: If true, use a schema to validate the input before sending it
|
||||||
|
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### config set-credentials
|
||||||
|
Sets a user entry in .kubeconfig
|
||||||
|
|
||||||
|
Specifying a name that already exists overwrites that user entry.
|
||||||
|
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
```
|
||||||
|
kubectl config set-credentials name [flags]
|
||||||
|
|
||||||
|
Available Flags:
|
||||||
|
--alsologtostderr=false: log to standard error as well as files
|
||||||
|
--api-version="": The API version to use when talking to the server
|
||||||
|
--auth-path="": auth-path for the user entry in .kubeconfig
|
||||||
|
--certificate-authority="": Path to a cert. file for the certificate authority.
|
||||||
|
--client-certificate="": client-certificate for the user entry in .kubeconfig
|
||||||
|
--client-key="": client-key for the user entry in .kubeconfig
|
||||||
|
--cluster="": The name of the kubeconfig cluster to use
|
||||||
|
--context="": The name of the kubeconfig context to use
|
||||||
|
--global=false: use the .kubeconfig from /home/username
|
||||||
|
-h, --help=false: help for set-credentials
|
||||||
|
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
||||||
|
--kubeconfig="": use a particular .kubeconfig file
|
||||||
|
--local=true: use the .kubeconfig in the currect directory
|
||||||
|
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
|
||||||
|
--log_dir=: If non-empty, write log files in this directory
|
||||||
|
--log_flush_frequency=5s: Maximum number of seconds between log flushes
|
||||||
|
--logtostderr=true: log to standard error instead of files
|
||||||
|
--match-server-version=false: Require server version to match client version
|
||||||
|
-n, --namespace="": If present, the namespace scope for this CLI request.
|
||||||
|
--ns-path="/home/username/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
||||||
|
-s, --server="": The address of the Kubernetes API server
|
||||||
|
--stderrthreshold=2: logs at or above this threshold go to stderr
|
||||||
|
--token="": token for the user entry in .kubeconfig
|
||||||
|
--user="": The name of the kubeconfig user to use
|
||||||
|
--v=0: log level for V logs
|
||||||
|
--validate=false: If true, use a schema to validate the input before sending it
|
||||||
|
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### config set-context
|
||||||
|
Sets a context entry in .kubeconfig
|
||||||
|
|
||||||
|
Specifying a name that already exists overwrites that context entry.
|
||||||
|
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
```
|
||||||
|
kubectl config set-context name [flags]
|
||||||
|
|
||||||
|
Available Flags:
|
||||||
|
--alsologtostderr=false: log to standard error as well as files
|
||||||
|
--api-version="": The API version to use when talking to the server
|
||||||
|
-a, --auth-path="": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
||||||
|
--certificate-authority="": Path to a cert. file for the certificate authority.
|
||||||
|
--client-certificate="": Path to a client key file for TLS.
|
||||||
|
--client-key="": Path to a client key file for TLS.
|
||||||
|
--cluster="": cluster for the context entry in .kubeconfig
|
||||||
|
--context="": The name of the kubeconfig context to use
|
||||||
|
--global=false: use the .kubeconfig from /home/username
|
||||||
|
-h, --help=false: help for set-context
|
||||||
|
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
||||||
|
--kubeconfig="": use a particular .kubeconfig file
|
||||||
|
--local=true: use the .kubeconfig in the currect directory
|
||||||
|
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
|
||||||
|
--log_dir=: If non-empty, write log files in this directory
|
||||||
|
--log_flush_frequency=5s: Maximum number of seconds between log flushes
|
||||||
|
--logtostderr=true: log to standard error instead of files
|
||||||
|
--match-server-version=false: Require server version to match client version
|
||||||
|
--namespace="": namespace for the context entry in .kubeconfig
|
||||||
|
--ns-path="/home/username/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
||||||
|
-s, --server="": The address of the Kubernetes API server
|
||||||
|
--stderrthreshold=2: logs at or above this threshold go to stderr
|
||||||
|
--token="": Bearer token for authentication to the API server.
|
||||||
|
--user="": user for the context entry in .kubeconfig
|
||||||
|
--v=0: log level for V logs
|
||||||
|
--validate=false: If true, use a schema to validate the input before sending it
|
||||||
|
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### config set
|
||||||
|
Sets an individual value in a .kubeconfig file
|
||||||
|
|
||||||
|
property-name is a dot delimitted name where each token represents either a attribute name or a map key. Map keys may not contain dots.
|
||||||
|
property-value is the new value you wish to set.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
```
|
||||||
|
kubectl config set property-name property-value [flags]
|
||||||
|
|
||||||
|
Available Flags:
|
||||||
|
--alsologtostderr=false: log to standard error as well as files
|
||||||
|
--api-version="": The API version to use when talking to the server
|
||||||
|
-a, --auth-path="": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
||||||
|
--certificate-authority="": Path to a cert. file for the certificate authority.
|
||||||
|
--client-certificate="": Path to a client key file for TLS.
|
||||||
|
--client-key="": Path to a client key file for TLS.
|
||||||
|
--cluster="": The name of the kubeconfig cluster to use
|
||||||
|
--context="": The name of the kubeconfig context to use
|
||||||
|
--global=false: use the .kubeconfig from /home/username
|
||||||
|
-h, --help=false: help for config
|
||||||
|
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
||||||
|
--kubeconfig="": use a particular .kubeconfig file
|
||||||
|
--local=true: use the .kubeconfig in the currect directory
|
||||||
|
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
|
||||||
|
--log_dir=: If non-empty, write log files in this directory
|
||||||
|
--log_flush_frequency=5s: Maximum number of seconds between log flushes
|
||||||
|
--logtostderr=true: log to standard error instead of files
|
||||||
|
--match-server-version=false: Require server version to match client version
|
||||||
|
-n, --namespace="": If present, the namespace scope for this CLI request.
|
||||||
|
--ns-path="/home/username/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
||||||
|
-s, --server="": The address of the Kubernetes API server
|
||||||
|
--stderrthreshold=2: logs at or above this threshold go to stderr
|
||||||
|
--token="": Bearer token for authentication to the API server.
|
||||||
|
--user="": The name of the kubeconfig user to use
|
||||||
|
--v=0: log level for V logs
|
||||||
|
--validate=false: If true, use a schema to validate the input before sending it
|
||||||
|
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### config unset
|
||||||
|
Unsets an individual value in a .kubeconfig file
|
||||||
|
|
||||||
|
property-name is a dot delimitted name where each token represents either a attribute name or a map key. Map keys may not contain dots.
|
||||||
|
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
```
|
||||||
|
kubectl config unset property-name [flags]
|
||||||
|
|
||||||
|
Available Flags:
|
||||||
|
--alsologtostderr=false: log to standard error as well as files
|
||||||
|
--api-version="": The API version to use when talking to the server
|
||||||
|
-a, --auth-path="": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
||||||
|
--certificate-authority="": Path to a cert. file for the certificate authority.
|
||||||
|
--client-certificate="": Path to a client key file for TLS.
|
||||||
|
--client-key="": Path to a client key file for TLS.
|
||||||
|
--cluster="": The name of the kubeconfig cluster to use
|
||||||
|
--context="": The name of the kubeconfig context to use
|
||||||
|
--global=false: use the .kubeconfig from /home/username
|
||||||
|
-h, --help=false: help for config
|
||||||
|
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
||||||
|
--kubeconfig="": use a particular .kubeconfig file
|
||||||
|
--local=true: use the .kubeconfig in the currect directory
|
||||||
|
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
|
||||||
|
--log_dir=: If non-empty, write log files in this directory
|
||||||
|
--log_flush_frequency=5s: Maximum number of seconds between log flushes
|
||||||
|
--logtostderr=true: log to standard error instead of files
|
||||||
|
--match-server-version=false: Require server version to match client version
|
||||||
|
-n, --namespace="": If present, the namespace scope for this CLI request.
|
||||||
|
--ns-path="/home/username/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
||||||
|
-s, --server="": The address of the Kubernetes API server
|
||||||
|
--stderrthreshold=2: logs at or above this threshold go to stderr
|
||||||
|
--token="": Bearer token for authentication to the API server.
|
||||||
|
--user="": The name of the kubeconfig user to use
|
||||||
|
--v=0: log level for V logs
|
||||||
|
--validate=false: If true, use a schema to validate the input before sending it
|
||||||
|
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### config use-context
|
||||||
|
Sets the current-context in a .kubeconfig file
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
```
|
||||||
|
kubectl config use-context context-name [flags]
|
||||||
|
|
||||||
|
Available Flags:
|
||||||
|
--alsologtostderr=false: log to standard error as well as files
|
||||||
|
--api-version="": The API version to use when talking to the server
|
||||||
|
-a, --auth-path="": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
||||||
|
--certificate-authority="": Path to a cert. file for the certificate authority.
|
||||||
|
--client-certificate="": Path to a client key file for TLS.
|
||||||
|
--client-key="": Path to a client key file for TLS.
|
||||||
|
--cluster="": The name of the kubeconfig cluster to use
|
||||||
|
--context="": The name of the kubeconfig context to use
|
||||||
|
--global=false: use the .kubeconfig from /home/username
|
||||||
|
-h, --help=false: help for config
|
||||||
|
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
||||||
|
--kubeconfig="": use a particular .kubeconfig file
|
||||||
|
--local=true: use the .kubeconfig in the currect directory
|
||||||
|
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
|
||||||
|
--log_dir=: If non-empty, write log files in this directory
|
||||||
|
--log_flush_frequency=5s: Maximum number of seconds between log flushes
|
||||||
|
--logtostderr=true: log to standard error instead of files
|
||||||
|
--match-server-version=false: Require server version to match client version
|
||||||
|
-n, --namespace="": If present, the namespace scope for this CLI request.
|
||||||
|
--ns-path="/home/username/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
||||||
|
-s, --server="": The address of the Kubernetes API server
|
||||||
|
--stderrthreshold=2: logs at or above this threshold go to stderr
|
||||||
|
--token="": Bearer token for authentication to the API server.
|
||||||
|
--user="": The name of the kubeconfig user to use
|
||||||
|
--v=0: log level for V logs
|
||||||
|
--validate=false: If true, use a schema to validate the input before sending it
|
||||||
|
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### namespace
|
||||||
|
Set and view the current Kubernetes namespace scope for command line requests.
|
||||||
|
|
||||||
|
A Kubernetes namespace subdivides the cluster into groups of logically related pods, services, and replication controllers.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
$ kubectl namespace
|
||||||
|
Using namespace default
|
||||||
|
|
||||||
|
$ kubectl namespace other
|
||||||
|
Set current namespace to other
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
```
|
||||||
|
kubectl namespace [<namespace>] [flags]
|
||||||
|
|
||||||
|
Available Flags:
|
||||||
|
--alsologtostderr=false: log to standard error as well as files
|
||||||
|
--api-version="": The API version to use when talking to the server
|
||||||
|
-a, --auth-path="": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
||||||
|
--certificate-authority="": Path to a cert. file for the certificate authority.
|
||||||
|
--client-certificate="": Path to a client key file for TLS.
|
||||||
|
--client-key="": Path to a client key file for TLS.
|
||||||
|
--cluster="": The name of the kubeconfig cluster to use
|
||||||
|
--context="": The name of the kubeconfig context to use
|
||||||
|
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
||||||
|
--kubeconfig="": Path to the kubeconfig file to use for CLI requests.
|
||||||
|
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
|
||||||
|
--log_dir=: If non-empty, write log files in this directory
|
||||||
|
--log_flush_frequency=5s: Maximum number of seconds between log flushes
|
||||||
|
--logtostderr=true: log to standard error instead of files
|
||||||
|
--match-server-version=false: Require server version to match client version
|
||||||
|
-n, --namespace="": If present, the namespace scope for this CLI request.
|
||||||
|
--ns-path="/home/username/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
||||||
|
-s, --server="": The address of the Kubernetes API server
|
||||||
|
--stderrthreshold=2: logs at or above this threshold go to stderr
|
||||||
|
--token="": Bearer token for authentication to the API server.
|
||||||
|
--user="": The name of the kubeconfig user to use
|
||||||
|
--v=0: log level for V logs
|
||||||
|
--validate=false: If true, use a schema to validate the input before sending it
|
||||||
|
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### log
|
||||||
|
Print the logs for a container in a pod. If the pod has only one container, the container name is optional
|
||||||
|
Examples:
|
||||||
|
$ kubectl log 123456-7890 ruby-container
|
||||||
|
<returns snapshot of ruby-container logs from pod 123456-7890>
|
||||||
|
|
||||||
|
$ kubectl log -f 123456-7890 ruby-container
|
||||||
|
<starts streaming of ruby-container logs from pod 123456-7890>
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
```
|
||||||
|
kubectl log [-f] <pod> [<container>] [flags]
|
||||||
|
|
||||||
|
Available Flags:
|
||||||
|
--alsologtostderr=false: log to standard error as well as files
|
||||||
|
--api-version="": The API version to use when talking to the server
|
||||||
|
-a, --auth-path="": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
||||||
|
--certificate-authority="": Path to a cert. file for the certificate authority.
|
||||||
|
--client-certificate="": Path to a client key file for TLS.
|
||||||
|
--client-key="": Path to a client key file for TLS.
|
||||||
|
--cluster="": The name of the kubeconfig cluster to use
|
||||||
|
--context="": The name of the kubeconfig context to use
|
||||||
|
-f, --follow=false: Specify if the logs should be streamed.
|
||||||
|
-h, --help=false: help for log
|
||||||
|
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
||||||
|
--kubeconfig="": Path to the kubeconfig file to use for CLI requests.
|
||||||
|
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
|
||||||
|
--log_dir=: If non-empty, write log files in this directory
|
||||||
|
--log_flush_frequency=5s: Maximum number of seconds between log flushes
|
||||||
|
--logtostderr=true: log to standard error instead of files
|
||||||
|
--match-server-version=false: Require server version to match client version
|
||||||
|
-n, --namespace="": If present, the namespace scope for this CLI request.
|
||||||
|
--ns-path="/home/username/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
||||||
|
-s, --server="": The address of the Kubernetes API server
|
||||||
|
--stderrthreshold=2: logs at or above this threshold go to stderr
|
||||||
|
--token="": Bearer token for authentication to the API server.
|
||||||
|
--user="": The name of the kubeconfig user to use
|
||||||
|
--v=0: log level for V logs
|
||||||
|
--validate=false: If true, use a schema to validate the input before sending it
|
||||||
|
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### rollingupdate
|
||||||
|
Perform a rolling update of the given ReplicationController.
|
||||||
|
|
||||||
|
Replaces named controller with new controller, updating one pod at a time to use the
|
||||||
|
new PodTemplate. The new-controller.json must specify the same namespace as the
|
||||||
|
existing controller and overwrite at least one (common) label in its replicaSelector.
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
$ kubectl rollingupdate frontend-v1 -f frontend-v2.json
|
||||||
|
<update pods of frontend-v1 using new controller data in frontend-v2.json>
|
||||||
|
|
||||||
|
$ cat frontend-v2.json | kubectl rollingupdate frontend-v1 -f -
|
||||||
|
<update pods of frontend-v1 using json data passed into stdin>
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
```
|
||||||
|
kubectl rollingupdate <old-controller-name> -f <new-controller.json> [flags]
|
||||||
|
|
||||||
|
Available Flags:
|
||||||
|
--alsologtostderr=false: log to standard error as well as files
|
||||||
|
--api-version="": The API version to use when talking to the server
|
||||||
|
-a, --auth-path="": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
||||||
|
--certificate-authority="": Path to a cert. file for the certificate authority.
|
||||||
|
--client-certificate="": Path to a client key file for TLS.
|
||||||
|
--client-key="": Path to a client key file for TLS.
|
||||||
|
--cluster="": The name of the kubeconfig cluster to use
|
||||||
|
--context="": The name of the kubeconfig context to use
|
||||||
|
-f, --filename="": Filename or URL to file to use to create the new controller
|
||||||
|
-h, --help=false: help for rollingupdate
|
||||||
|
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
||||||
|
--kubeconfig="": Path to the kubeconfig file to use for CLI requests.
|
||||||
|
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
|
||||||
|
--log_dir=: If non-empty, write log files in this directory
|
||||||
|
--log_flush_frequency=5s: Maximum number of seconds between log flushes
|
||||||
|
--logtostderr=true: log to standard error instead of files
|
||||||
|
--match-server-version=false: Require server version to match client version
|
||||||
|
-n, --namespace="": If present, the namespace scope for this CLI request.
|
||||||
|
--ns-path="/home/username/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
||||||
|
--poll-interval="3s": Time delay between polling controller status after update. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
|
||||||
|
-s, --server="": The address of the Kubernetes API server
|
||||||
|
--stderrthreshold=2: logs at or above this threshold go to stderr
|
||||||
|
--timeout="5m0s": Max time to wait for a controller to update before giving up. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
|
||||||
|
--token="": Bearer token for authentication to the API server.
|
||||||
|
--update-period="1m0s": Time to wait between updating pods. Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
|
||||||
|
--user="": The name of the kubeconfig user to use
|
||||||
|
--v=0: log level for V logs
|
||||||
|
--validate=false: If true, use a schema to validate the input before sending it
|
||||||
|
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
#### run-container
|
||||||
|
Create and run a particular image, possibly replicated.
|
||||||
|
Creates a replication controller to manage the created container(s)
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
$ kubectl run-container nginx --image=dockerfile/nginx
|
||||||
|
<starts a single instance of nginx>
|
||||||
|
|
||||||
|
$ kubectl run-container nginx --image=dockerfile/nginx --replicas=5
|
||||||
|
<starts a replicated instance of nginx>
|
||||||
|
|
||||||
|
$ kubectl run-container nginx --image=dockerfile/nginx --dry-run
|
||||||
|
<just print the corresponding API objects, don't actually send them to the apiserver>
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
```
|
||||||
|
kubectl run-container <name> --image=<image> [--replicas=replicas] [--dry-run=<bool>] [flags]
|
||||||
|
|
||||||
|
Available Flags:
|
||||||
|
--alsologtostderr=false: log to standard error as well as files
|
||||||
|
--api-version="": The API version to use when talking to the server
|
||||||
|
-a, --auth-path="": Path to the auth info file. If missing, prompt the user. Only used if using https.
|
||||||
|
--certificate-authority="": Path to a cert. file for the certificate authority.
|
||||||
|
--client-certificate="": Path to a client key file for TLS.
|
||||||
|
--client-key="": Path to a client key file for TLS.
|
||||||
|
--cluster="": The name of the kubeconfig cluster to use
|
||||||
|
--context="": The name of the kubeconfig context to use
|
||||||
|
--dry-run=false: If true, only print the object that would be sent, don't actually do anything
|
||||||
|
--generator="run-container/v1": The name of the api generator that you want to use. Default 'run-container-controller-v1'
|
||||||
|
-h, --help=false: help for run-container
|
||||||
|
--image="": The image for the container you wish to run.
|
||||||
|
--insecure-skip-tls-verify=false: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
|
||||||
|
--kubeconfig="": Path to the kubeconfig file to use for CLI requests.
|
||||||
|
-l, --labels="": Labels to apply to the pod(s) created by this call to run.
|
||||||
|
--log_backtrace_at=:0: when logging hits line file:N, emit a stack trace
|
||||||
|
--log_dir=: If non-empty, write log files in this directory
|
||||||
|
--log_flush_frequency=5s: Maximum number of seconds between log flushes
|
||||||
|
--logtostderr=true: log to standard error instead of files
|
||||||
|
--match-server-version=false: Require server version to match client version
|
||||||
|
-n, --namespace="": If present, the namespace scope for this CLI request.
|
||||||
|
--no-headers=false: When using the default output, don't print headers
|
||||||
|
--ns-path="/home/username/.kubernetes_ns": Path to the namespace info file that holds the namespace context to use for CLI requests.
|
||||||
|
-o, --output="": Output format: json|yaml|template|templatefile
|
||||||
|
--output-version="": Output the formatted object with the given version (default api-version)
|
||||||
|
-r, --replicas=1: Number of replicas to create for this container. Default 1
|
||||||
|
-s, --server="": The address of the Kubernetes API server
|
||||||
|
--stderrthreshold=2: logs at or above this threshold go to stderr
|
||||||
|
-t, --template="": Template string or path to template file to use when -o=template or -o=templatefile.
|
||||||
|
--token="": Bearer token for authentication to the API server.
|
||||||
|
--user="": The name of the kubeconfig user to use
|
||||||
|
--v=0: log level for V logs
|
||||||
|
--validate=false: If true, use a schema to validate the input before sending it
|
||||||
|
--vmodule=: comma-separated list of pattern=N settings for file-filtered logging
|
||||||
|
|
||||||
|
```
|
||||||
|
|
@ -46,6 +46,7 @@ readonly KUBE_CLIENT_BINARIES_WIN=("${KUBE_CLIENT_BINARIES[@]/%/.exe}")
|
|||||||
readonly KUBE_TEST_TARGETS=(
|
readonly KUBE_TEST_TARGETS=(
|
||||||
cmd/e2e
|
cmd/e2e
|
||||||
cmd/integration
|
cmd/integration
|
||||||
|
cmd/gendocs
|
||||||
)
|
)
|
||||||
readonly KUBE_TEST_BINARIES=("${KUBE_TEST_TARGETS[@]##*/}")
|
readonly KUBE_TEST_BINARIES=("${KUBE_TEST_TARGETS[@]##*/}")
|
||||||
readonly KUBE_TEST_BINARIES_WIN=("${KUBE_TEST_BINARIES[@]/%/.exe}")
|
readonly KUBE_TEST_BINARIES_WIN=("${KUBE_TEST_BINARIES[@]/%/.exe}")
|
||||||
|
94
hack/verify-gendocs.sh
Executable file
94
hack/verify-gendocs.sh
Executable file
@ -0,0 +1,94 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright 2014 Google Inc. All rights reserved.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
set -o errexit
|
||||||
|
set -o nounset
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||||
|
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||||
|
|
||||||
|
kube::golang::setup_env
|
||||||
|
"${KUBE_ROOT}/hack/build-go.sh" cmd/gendocs
|
||||||
|
|
||||||
|
# Get the absolute path of the directory component of a file, i.e. the
|
||||||
|
# absolute path of the dirname of $1.
|
||||||
|
get_absolute_dirname() {
|
||||||
|
echo "$(cd "$(dirname "$1")" && pwd)"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Detect the OS name/arch so that we can find our binary
|
||||||
|
case "$(uname -s)" in
|
||||||
|
Darwin)
|
||||||
|
host_os=darwin
|
||||||
|
;;
|
||||||
|
Linux)
|
||||||
|
host_os=linux
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unsupported host OS. Must be Linux or Mac OS X." >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case "$(uname -m)" in
|
||||||
|
x86_64*)
|
||||||
|
host_arch=amd64
|
||||||
|
;;
|
||||||
|
i?86_64*)
|
||||||
|
host_arch=amd64
|
||||||
|
;;
|
||||||
|
amd64*)
|
||||||
|
host_arch=amd64
|
||||||
|
;;
|
||||||
|
arm*)
|
||||||
|
host_arch=arm
|
||||||
|
;;
|
||||||
|
i?86*)
|
||||||
|
host_arch=x86
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unsupported host arch. Must be x86_64, 386 or arm." >&2
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Find binary
|
||||||
|
locations=(
|
||||||
|
"${KUBE_ROOT}/_output/dockerized/bin/${host_os}/${host_arch}/gendocs"
|
||||||
|
"${KUBE_ROOT}/_output/local/bin/${host_os}/${host_arch}/gendocs"
|
||||||
|
"${KUBE_ROOT}/platforms/${host_os}/${host_arch}/gendocs"
|
||||||
|
)
|
||||||
|
gendocs=$( (ls -t "${locations[@]}" 2>/dev/null || true) | head -1 )
|
||||||
|
|
||||||
|
if [[ ! -x "$gendocs" ]]; then
|
||||||
|
{
|
||||||
|
echo "It looks as if you don't have a compiled gendocs binary"
|
||||||
|
echo
|
||||||
|
echo "If you are running from a clone of the git repo, please run"
|
||||||
|
echo "'./hack/build-go.sh cmd/gendocs'."
|
||||||
|
} >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
KUBECTL_DOC="docs/kubectl.md"
|
||||||
|
|
||||||
|
echo "diffing ${KUBECTL_DOC} against generated output from ${gendocs}"
|
||||||
|
"${gendocs}" | diff "${KUBE_ROOT}/${KUBECTL_DOC}" - && echo "${KUBECTL_DOC} up to date." || {
|
||||||
|
echo "${KUBECTL_DOC} is out of date. Please run ${gendocs} > ${KUBECTL_DOC}"
|
||||||
|
exit 1
|
||||||
|
}
|
@ -34,8 +34,8 @@ const (
|
|||||||
func (f *Factory) NewCmdRollingUpdate(out io.Writer) *cobra.Command {
|
func (f *Factory) NewCmdRollingUpdate(out io.Writer) *cobra.Command {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "rollingupdate <old-controller-name> -f <new-controller.json>",
|
Use: "rollingupdate <old-controller-name> -f <new-controller.json>",
|
||||||
Short: "Perform a rolling update of the given replicationController",
|
Short: "Perform a rolling update of the given ReplicationController",
|
||||||
Long: `Perform a rolling update of the given replicationController.",
|
Long: `Perform a rolling update of the given ReplicationController.
|
||||||
|
|
||||||
Replaces named controller with new controller, updating one pod at a time to use the
|
Replaces named controller with new controller, updating one pod at a time to use the
|
||||||
new PodTemplate. The new-controller.json must specify the same namespace as the
|
new PodTemplate. The new-controller.json must specify the same namespace as the
|
||||||
|
Loading…
Reference in New Issue
Block a user