← Services531 / 640
hardkubectl

Create an internal ClusterIP service with a specific port mapping

command

kubectl create service clusterip SERVICE --tcp=PORT:TARGET_PORT

also accepted

kubectl create service clusterip

Command breakdown

Part of the Kubernetes CLI (kubectl) — Services category.

kubectlcreateserviceclusteripSERVICE--tcp=PORT:TARGET_PORT
FlagPurpose
--tcpSet to: PORT:TARGET_PORT

Test your recall — not just your reading.

Practice with interactive quiz →