Difference between revisions of "Kubectl expose"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Tags: Mobile web edit, Mobile edit
Line 6: Line 6:
  
 
<code>[[kubectl expose pod]] check-ip --name check-ip-service --port 80</code>
 
<code>[[kubectl expose pod]] check-ip --name check-ip-service --port 80</code>
 +
service/check-ip exposed
  
 
<code>kubectl expose rc nginx --port=80 --target-port=8000</code>
 
<code>kubectl expose rc nginx --port=80 --target-port=8000</code>

Revision as of 14:51, 28 March 2023

kubectl expose take a replication controller, service, replica set or pod and expose it as a new Kubernetes Service

kubectl expose deployment nginxapp --name=nginxclusterip --port=80 --target-port=8080

kubectl expose pod check-ip --name check-ip-service --port 80

service/check-ip exposed

kubectl expose rc nginx --port=80 --target-port=8000 https://kubernetes.io/docs/reference/kubectl/cheatsheet/#updating-resources

kubectl expose deployment your-deployment-name --type=LoadBalancer --name=my-service
service/my-service exposed

Related

See also

Advertising: