← Services528 / 640
hardkubectl

Expose a deployment as a NodePort service accessible on every cluster node

command

kubectl expose deployment DEPLOYMENT --port PORT --target-port TARGET_PORT --type NodePort

also accepted

kubectl expose deploymentkubectl expose deployment DEPLOYMENT --type NodePort

Test your recall — not just your reading.

Practice with interactive quiz →