← Services530 / 640
hardkubectl

Change the type of a service from ClusterIP to LoadBalancer using a JSON patch

command

kubectl patch service SERVICE -p '{"spec":{"type":"LoadBalancer"}}'

also accepted

kubectl patch service

Command breakdown

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

kubectlpatchserviceSERVICE-p'{"spec":{"type":"LoadBalancer"}}'
FlagPurpose
-pBoolean flag

Test your recall — not just your reading.

Practice with interactive quiz →