--create-external-load-balancer=false: If true, create an external load balancer for this service. Implementation is cloud provider dependent. Default is 'false'.
--create-external-load-balancer=false: If true, create an external load balancer for this service (trumped by --type). Implementation is cloud provider dependent. Default is 'false'.
--dry-run=false: If true, only print the object that would be sent, without creating it.
--generator="service/v1": The name of the API generator to use. Default is 'service/v1'.
--selector="": A label selector to use for this service. If empty (the default) infer the selector from the replication controller.
--target-port="": Name or number for the port on the container that the service should direct traffic to. Optional.
-t, --template="": Template string or path to template file to use when -o=template or -o=templatefile. The template format is golang templates [http://golang.org/pkg/text/template/#pkg-overview]
--type="": Type for this service: ClusterIP, NodePort, or LoadBalancer. Default is 'ClusterIP' unless --create-external-load-balancer is specified.
// Service Type string describes ingress methods for a service
typeServiceTypestring
const(
// ServiceTypeClusterIP means a service will only be accessible inside the
// cluster, via the portal IP.
ServiceTypeClusterIPServiceType="ClusterIP"
// ServiceTypeLoadBalancer means a service will be exposed via an
// external load balancer (if the cloud provider supports it), in addition
// to 'NodePort' type.
ServiceTypeLoadBalancerServiceType="LoadBalancer"
)
// ServiceStatus represents the current status of a service
typeServiceStatusstruct{
// LoadBalancer contains the current status of the load-balancer,
...
...
@@ -1034,8 +1048,8 @@ type ServiceSpec struct {
// None can be specified for headless services when proxying is not required
PortalIPstring`json:"portalIP,omitempty description: IP address of the service; usually assigned by the system; if specified, it will be allocated to the service if unused, and creation of the service will fail otherwise; cannot be updated; 'None' can be specified for a headless service when proxying is not required"`
// CreateExternalLoadBalancer indicates whether a load balancer should be created for this service.
CreateExternalLoadBalancerbool`json:"createExternalLoadBalancer,omitempty" description:"set up a cloud-provider-specific load balancer on an external IP"`
// Type determines how the service will be exposed. Valid options: ClusterIP, NodePort, LoadBalancer
TypeServiceType`json:"type,omitempty" description:"type of this service; must be ClusterIP, NodePort, or LoadBalancer; defaults to ClusterIP"`
// PublicIPs are used by external load balancers, or can be set by
// users to handle external traffic that arrives at a node.
// Service Type string describes ingress methods for a service
typeServiceTypestring
const(
// ServiceTypeClusterIP means a service will only be accessible inside the
// cluster, via the portal IP.
ServiceTypeClusterIPServiceType="ClusterIP"
// ServiceTypeLoadBalancer means a service will be exposed via an
// external load balancer (if the cloud provider supports it), in addition
// to 'NodePort' type.
ServiceTypeLoadBalancerServiceType="LoadBalancer"
)
const(
// PortalIPNone - do not assign a portal IP
// no proxying required and no environment variables should be created for pods
...
...
@@ -873,6 +887,9 @@ type Service struct {
// An external load balancer should be set up via the cloud-provider
CreateExternalLoadBalancerbool`json:"createExternalLoadBalancer,omitempty" description:"set up a cloud-provider-specific load balancer on an external IP"`
// Type determines how the service will be exposed. Valid options: ClusterIP, NodePort, LoadBalancer
TypeServiceType`json:"type,omitempty" description:"type of this service; must be ClusterIP, NodePort, or LoadBalancer; defaults to ClusterIP"`
// PublicIPs are used by external load balancers, or can be set by
// users to handle external traffic that arrives at a node.
PublicIPs[]string`json:"publicIPs,omitempty" description:"externally visible IPs (e.g. load balancers) that should be proxied to this service"`
// Service Type string describes ingress methods for a service
typeServiceTypestring
const(
// ServiceTypeClusterIP means a service will only be accessible inside the
// cluster, via the portal IP.
ServiceTypeClusterIPServiceType="ClusterIP"
// ServiceTypeLoadBalancer means a service will be exposed via an
// external load balancer (if the cloud provider supports it), in addition
// to 'NodePort' type.
ServiceTypeLoadBalancerServiceType="LoadBalancer"
)
const(
// PortalIPNone - do not assign a portal IP
// no proxying required and no environment variables should be created for pods
...
...
@@ -877,6 +891,9 @@ type Service struct {
// An external load balancer should be set up via the cloud-provider
CreateExternalLoadBalancerbool`json:"createExternalLoadBalancer,omitempty" description:"set up a cloud-provider-specific load balancer on an external IP"`
// Type determines how the service will be exposed. Valid options: ClusterIP, NodePort, LoadBalancer
TypeServiceType`json:"type,omitempty" description:"type of this service; must be ClusterIP, NodePort, or LoadBalancer; defaults to ClusterIP"`
// PublicIPs are used by external load balancers, or can be set by
// users to handle external traffic that arrives at a node.
PublicIPs[]string`json:"publicIPs,omitempty" description:"externally visible IPs (e.g. load balancers) that should be proxied to this service"`
// Service Type string describes ingress methods for a service
typeServiceTypestring
const(
// ServiceTypeClusterIP means a service will only be accessible inside the
// cluster, via the portal IP.
ServiceTypeClusterIPServiceType="ClusterIP"
// ServiceTypeLoadBalancer means a service will be exposed via an
// external load balancer (if the cloud provider supports it), in addition
// to 'NodePort' type.
ServiceTypeLoadBalancerServiceType="LoadBalancer"
)
// ServiceStatus represents the current status of a service
typeServiceStatusstruct{
// LoadBalancer contains the current status of the load-balancer,
...
...
@@ -1041,6 +1055,9 @@ type ServiceSpec struct {
// CreateExternalLoadBalancer indicates whether a load balancer should be created for this service.
CreateExternalLoadBalancerbool`json:"createExternalLoadBalancer,omitempty" description:"set up a cloud-provider-specific load balancer on an external IP"`
// Type determines how the service will be exposed. Valid options: ClusterIP, NodePort, LoadBalancer
TypeServiceType`json:"type,omitempty" description:"type of this service; must be ClusterIP, NodePort, or LoadBalancer; defaults to ClusterIP"`
// PublicIPs are used by external load balancers, or can be set by
// users to handle external traffic that arrives at a node.
PublicIPs[]string`json:"publicIPs,omitempty" description:"externally visible IPs (e.g. load balancers) that should be proxied to this service"`
cmd.Flags().String("protocol","TCP","The network protocol for the service to be created. Default is 'tcp'.")
cmd.Flags().Int("port",-1,"The port that the service should serve on. Required.")
cmd.MarkFlagRequired("port")
cmd.Flags().Bool("create-external-load-balancer",false,"If true, create an external load balancer for this service. Implementation is cloud provider dependent. Default is 'false'.")
cmd.Flags().String("type","","Type for this service: ClusterIP, NodePort, or LoadBalancer. Default is 'ClusterIP' unless --create-external-load-balancer is specified.")
cmd.Flags().Bool("create-external-load-balancer",false,"If true, create an external load balancer for this service (trumped by --type). Implementation is cloud provider dependent. Default is 'false'.")
cmd.Flags().String("selector","","A label selector to use for this service. If empty (the default) infer the selector from the replication controller.")
cmd.Flags().StringP("labels","l","","Labels to apply to the service created by this call.")
cmd.Flags().Bool("dry-run",false,"If true, only print the object that would be sent, without creating it.")