kubectl-expose: add page (#11111)

* kubectl expose: add page

* kubectl expose: fix language

Co-authored-by: Juri Dispan <juri.dispan@posteo.net>

* kubectl expose: fix language

Co-authored-by: Juri Dispan <juri.dispan@posteo.net>

---------

Co-authored-by: Juri Dispan <juri.dispan@posteo.net>
This commit is contained in:
Aditya Shrivastav
2023-10-21 12:48:02 +05:30
committed by GitHub
parent ed83a9e2f0
commit 9417500911

View File

@@ -0,0 +1,16 @@
# kubectl edit
> Expose a resource as a new Kubernetes service.
> More information: <https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#expose>.
- Create a service for a resource, which will be served from container port to node port:
`kubectl expose {{resource_type}} {{resource_name}} --port={{node_port}} --target-port={{container_port}}`
- Create a service for a resource identified by a file:
`kubectl expose -f {{path/to/file.yml}} --port={{node_port}} --target-port={{container_port}}`
- Create a service with a name, to serve to a node port which will be same for container port:
`kubectl expose {{resource_type}} {{resource_name}} --port={{node_port}} --name={{service_name}}`