Difference between revisions of "Kubectl expose"

From NovaOrdis Knowledge Base
Jump to: navigation, search
(Created page with "=Internal= * kubectl =Overview= <tt>expose</tt> dynamically exposes a resource (pod, etc.) as a new service. kubectl expose pod valid-pod --port=444...")
 
(Overview)
(One intermediate revision by the same user not shown)
Line 5: Line 5:
 
=Overview=
 
=Overview=
  
<tt>expose</tt> dynamically exposes a resource (pod, etc.) as a new service.
+
<tt>expose</tt> dynamically exposes a resource (pod, service, replicationcontroller, deployment, replicaset) as a new service. The default service type is ClusterIP, other type (NodePort, LoadBalancer, or ExternalName) can be specified with --type.
  
  kubectl expose pod valid-pod --port=444 --name=frontend
+
  kubectl expose pod pg-0 --port=5432 --name=postgres --type=NodePort

Revision as of 23:04, 13 August 2019

Internal

Overview

expose dynamically exposes a resource (pod, service, replicationcontroller, deployment, replicaset) as a new service. The default service type is ClusterIP, other type (NodePort, LoadBalancer, or ExternalName) can be specified with --type.

kubectl expose pod pg-0 --port=5432 --name=postgres --type=NodePort