Pages

Sunday, August 16, 2020

Kubernetes Service Type using -type options

The command to expose the replication controller 

kubectl expose rc myapp-rc --name=myapp-rc-service --type=NodePort

The --name option sets a name for the service. 
The --type option sets the service type, and can be one of the following four values:

  • ClusterIP: The default value that exposes the pods internal to the cluster. 
  • NodePort: Exposes the pods as a static port on each node that contains the pods
  • LoadBalancer: Exposes the pods externally using a load balancer of a cloud provider. 
  • ExternalName: Available from version 1.7 of kube-dns to expose the pods through the contents of the externalName field.

No comments:

Post a Comment