kubectl expose
SafeExpose as a Service
kubectl expose deploy <name> --port=80
Generates a Service for an existing workload — quick exposure for testing.
Examples
kubectl expose deploy web --port=80 --type=NodePortExpose via NodePort
Syntax
kubectl expose <res> <name> --port=N [--type=NodePort]
Before you run it
Adds a Service only.
Related commands
- kubectl get svcList services
- kubectl port-forwardPort-forward
The same reference, with no signal at all
Every command on this site, held on your device. The app adds 632 more: 1,510 commands and 120 fix flows, searchable with no connection. Free to install, no ads (some content is a one-time purchase).
Get it free on the App Store