Difference between revisions of "Kubectl expose"

From wikieduonline
Jump to navigation Jump to search
 
(7 intermediate revisions by one other user not shown)
Line 5: Line 5:
 
<code>[[kubectl expose deployment]] nginxapp --name=nginxclusterip --port=80 --target-port=8080</code>
 
<code>[[kubectl expose deployment]] nginxapp --name=nginxclusterip --port=80 --target-port=8080</code>
  
<code>[[kubectl expose pod]] check-ip --name check-ip-service --port 80</code>
+
 
 +
[[kubectl expose pod]] your-pod --port 80
 +
service/your-pod exposed
 +
 
 +
[[kubectl expose pod]] your-pod --name check-ip-service --port 80
 +
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>
 
https://kubernetes.io/docs/reference/kubectl/cheatsheet/#updating-resources
 
https://kubernetes.io/docs/reference/kubectl/cheatsheet/#updating-resources
  
<code>[[kubectl expose deployment]] your-deployment-name --type=LoadBalancer --name=my-service
+
<code>[[kubectl expose deployment]] your-deployment-name --type=LoadBalancer --name=my-service
service/my-service exposed</code>
+
service/my-service exposed</code>
  
 
== Related ==
 
== Related ==
 
* [[Kubernetes services]]
 
* [[Kubernetes services]]
 +
* <code>[[kubectl get services -A]]</code>
 
* <code>[[kubectl get services my-service]]</code>
 
* <code>[[kubectl get services my-service]]</code>
 +
* [[DNS-1035]]
 +
 +
Error from server (AlreadyExists): services "mywiki-mediawiki" already exists
  
 
== See also ==
 
== See also ==

Latest revision as of 13:26, 6 February 2024

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 your-pod --port 80
service/your-pod exposed
kubectl expose pod your-pod --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[edit]

Error from server (AlreadyExists): services "mywiki-mediawiki" already exists

See also[edit]

Advertising: