KUBERNETES(1) kubernetes KUBERNETES(1) (NAME) kubectl-run - (SYNOPSIS) kubectl run [OPTIONS] (DESCRIPTION) . (OPTIONS) --allow-missing-template-keys=true true (map key) . golang jsonpath . --annotations=[] (annotations) . --attach=false true '... kubectl attach' . false '-i/--stdin' true . '--restart=Never' (exit code) . --cascade="background" "background" "orphan" "foreground" . ( ReplicationController) . background . --command=false true 'command' 'args' . --detach-keys="ctrl-p,ctrl-q" (detach) . --dry-run="none" "none" "server" "client" . client . server . --env=[] . --expose=false true ClusterIP . --port . --field-manager="kubectl-run" . -f, --filename=[] . --force=false true API . . --grace-period=-1 . . . --force true ( ). --image="" . --image-pull-policy="" (image pull policy) . . -k, --kustomize="" kustomization. -f -R . -l, --labels="" . . --leave-stdin-open=false stdin stdin . stdin . -o, --output="" . : (json, yaml, kyaml, name, go-template, go-template- file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath- file). --override-type="merge" : json merge strategic. --overrides="" JSON . . apiVersion . --pod-running-timeout=1m0s ( 5s 2m 3h ) --port="" (expose ). --privileged=false true (privileged mode) . -q, --quiet=false true (prompt) . --record=false kubectl . false . true . . -R, --recursive=false -f --filename. . --restart="Always" (restart policy) . [Always, OnFailure, Never]. --rm=false true . '--attach' '-i/--stdin'. --save-config=false true . kubectl apply . --show-managed-fields=false true managedFields JSON YAML . -i, --stdin=false (stdin) . --template="" -o=go-template -o=go-template-file. golang [http://golang.org/pkg/text/template/#pkg-overview]. --timeout=0s . -t, --tty=false TTY . --wait=false true . (finalizers) . (OPTIONS INHERITED FROM PARENT COMMANDS) --as="" (impersonate) . (service account) namespace . --as-group=[] . --as-uid="" UID . --as-user-extra=[] . --cache-dir="/home/username/.kube/cache" --certificate-authority="" (certificate authority) --client-certificate="" TLS --client-key="" TLS --cluster="" kubeconfig --context="" kubeconfig --disable-compression=false true --insecure-skip-tls-verify=false true . HTTPS --kubeconfig="" kubeconfig CLI. --kuberc="" kuberc (preferences). export feature gate KUBECTL_KUBERC=false KUBERC=off . --match-server-version=false -n, --namespace="" namespace CLI --password="" (basic authentication) API --profile="none" . (none|cpu|heap|goroutine|threadcreate|block|mutex|trace) --profile-output="profile.pprof" --request-timeout="0" . ( 1s 2m 3h). ( timeout). -s, --server="" Kubernetes API --tls-server-name="" . hostname --token="" Bearer API --user="" kubeconfig --username="" API --version=false --version --version=raw --version=vX.Y.Z... --warnings-as-errors=false (EXAMPLES) # nginx kubectl run nginx --image=nginx # hazelcast 5701 kubectl run hazelcast --image=hazelcast/hazelcast --port=5701 # hazelcast "DNS_DOMAIN=cluster" "POD_NAMESPACE=default" kubectl run hazelcast --image=hazelcast/hazelcast --env="DNS_DOMAIN=cluster" --env="POD_NAMESPACE=default" # hazelcast "app=hazelcast" "env=prod" kubectl run hazelcast --image=hazelcast/hazelcast --labels="app=hazelcast,env=prod" # (dry run) API kubectl run nginx --image=nginx --dry-run=client # nginx JSON kubectl run nginx --image=nginx --overrides='{ "apiVersion": "v1", "spec": { ... } }' # busybox kubectl run -i -t busybox --image=busybox --restart=Never # nginx (arg1 .. argN) kubectl run nginx --image=nginx -- ... # nginx kubectl run nginx --image=nginx --command -- ... (SEE ALSO) kubectl(1) (HISTORY) Eric Paris (eparis at redhat dot com) kubernetes ! Eric Paris Jan 2015 KUBERNETES(1)