Add Type to ServiceSpec: ClusterIP or LoadBalancer

This commit is contained in:
Justin Santa Barbara
2015-05-22 17:49:26 -04:00
parent 3884d5fc59
commit 973c2e4819
37 changed files with 434 additions and 146 deletions

View File

@@ -1011,6 +1011,20 @@ const (
ServiceAffinityNone ServiceAffinity = "None"
)
// Service Type string describes ingress methods for a service
type ServiceType string
const (
// ServiceTypeClusterIP means a service will only be accessible inside the
// cluster, via the portal IP.
ServiceTypeClusterIP ServiceType = "ClusterIP"
// ServiceTypeLoadBalancer means a service will be exposed via an
// external load balancer (if the cloud provider supports it), in addition
// to 'NodePort' type.
ServiceTypeLoadBalancer ServiceType = "LoadBalancer"
)
// ServiceStatus represents the current status of a service
type ServiceStatus struct {
// LoadBalancer contains the current status of the load-balancer,
@@ -1054,8 +1068,9 @@ type ServiceSpec struct {
// None can be specified for headless services when proxying is not required
PortalIP string `json:"portalIP,omitempty"`
// CreateExternalLoadBalancer indicates whether a load balancer should be created for this service.
CreateExternalLoadBalancer bool `json:"createExternalLoadBalancer,omitempty"`
// Type determines how the service will be exposed. Valid options: ClusterIP, NodePort, LoadBalancer
Type ServiceType `json:"type,omitempty"`
// PublicIPs are used by external load balancers, or can be set by
// users to handle external traffic that arrives at a node.
// For load balancers, the publicIP will usually be the IP address of the load balancer,