KUBERNETES(1) kubernetes KUBERNETES(1) (NAME) kubectl-expose - replication controller (SYNOPSIS) kubectl expose [OPTIONS] (DESCRIPTION) . (deployment) (service) replica set (replication controller) (pod) . replica set matchLabels . --port . (label) . ( ): pod (po), service (svc), replicationcontroller (rc), deployment (deploy), replicaset (rs) (OPTIONS) --allow-missing-template-keys=true true . golang jsonpath . --cluster-ip="" ClusterIP . headless 'None' . --dry-run="none" "none" "server" "client" . client . server . --external-ip="" IP ( Kubernetes ) . IP (route) IP IP . --field-manager="kubectl-expose" . -f, --filename=[] URL -k, --kustomize="" kustomization. -f -R . -l, --labels="" (labels) . --load-balancer-ip="" IP LoadBalancer. IP (ephemeral) ( ). --name="" . -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 . --port="" . --protocol="" . 'TCP' . --record=false kubectl . false . true . . -R, --recursive=false -f --filename. . --save-config=false true . . kubectl apply . --selector="" . (equality-based) . () . --session-affinity="" (session affinity) : 'None', 'ClientIP' --show-managed-fields=false true (managedFields) JSON YAML . --target-port="" . . --template="" -o=go-template -o=go-template-file . golang [http://golang.org/pkg/text/template/#pkg-overview]. --type="" : ClusterIP NodePort LoadBalancer ExternalName. 'ClusterIP' . (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 (EXAMPLE) # nginx replication controller 80 8000 kubectl expose rc nginx --port=80 --target-port=8000 # replication controller "nginx-controller.yaml" 80 8000 kubectl expose -f nginx-controller.yaml --port=80 --target-port=8000 # valid-pod 444 "frontend" kubectl expose pod valid-pod --port=444 --name=frontend # 8443 443 "nginx-https" kubectl expose service nginx --port=443 --target-port=8443 --name=nginx-https # 4100 UDP 'video-stream' kubectl expose rc streamer --port=4100 --protocol=UDP --name=video-stream # nginx replica set 80 8000 kubectl expose rs nginx --port=80 --target-port=8000 # (deployment) nginx 80 8000 kubectl expose deployment nginx --port=80 --target-port=8000 (SEE ALSO) kubectl(1) (HISTORY) Eric Paris (eparis at redhat dot com) kubernetes ! Eric Paris Jan 2015 KUBERNETES(1)