mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
Limit the type for kubectl expose command
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
|
||||
.SH NAME
|
||||
.PP
|
||||
kubectl expose \- Take a replicated application and expose it as Kubernetes Service
|
||||
kubectl expose \- Take a replication controller, service or pod and expose it as a new Kubernetes Service
|
||||
|
||||
|
||||
.SH SYNOPSIS
|
||||
@@ -13,10 +13,10 @@ kubectl expose \- Take a replicated application and expose it as Kubernetes Serv
|
||||
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Take a replicated application and expose it as Kubernetes Service.
|
||||
Take a replication controller, service or pod and expose it as a new Kubernetes Service.
|
||||
|
||||
.PP
|
||||
Looks up a replication controller or service by name and uses the selector for that resource as the
|
||||
Looks up a replication controller, service or pod by name and uses the selector for that resource as the
|
||||
selector for a new Service on the specified port. If no labels are specified, the new service will
|
||||
re\-use the labels from the resource it exposes.
|
||||
|
||||
@@ -219,6 +219,9 @@ $ kubectl expose rc nginx \-\-port=80 \-\-target\-port=8000
|
||||
# Create a service for a replication controller identified by type and name specified in "nginx\-controller.yaml", which serves on port 80 and connects to the containers on port 8000.
|
||||
$ kubectl expose \-f nginx\-controller.yaml \-\-port=80 \-\-target\-port=8000
|
||||
|
||||
# Create a service for a pod valid\-pod, which serves on port 444 with the name "frontend"
|
||||
$ kubectl expose pod valid\-pod \-\-port=444 \-\-name=frontend
|
||||
|
||||
# Create a second service based on the above service, exposing the container port 8443 as port 443 with the name "nginx\-https"
|
||||
$ kubectl expose service nginx \-\-port=443 \-\-target\-port=8443 \-\-name=nginx\-https
|
||||
|
||||
|
||||
Reference in New Issue
Block a user