Commit 92557700 authored by Justin Santa Barbara's avatar Justin Santa Barbara

Fix a few occurences of old language (e.g. visibility -> ServiceType)

parent 7346cc80
...@@ -1020,7 +1020,7 @@ const ( ...@@ -1020,7 +1020,7 @@ const (
ServiceTypeClusterIP ServiceType = "ClusterIP" ServiceTypeClusterIP ServiceType = "ClusterIP"
// ServiceTypeNodePort means a service will be exposed on one port of // ServiceTypeNodePort means a service will be exposed on one port of
// every node, in addition to 'ClusterIP' visibility. // every node, in addition to 'ClusterIP' type.
ServiceTypeNodePort ServiceType = "NodePort" ServiceTypeNodePort ServiceType = "NodePort"
// ServiceTypeLoadBalancer means a service will be exposed via an // ServiceTypeLoadBalancer means a service will be exposed via an
...@@ -1106,7 +1106,7 @@ type ServicePort struct { ...@@ -1106,7 +1106,7 @@ type ServicePort struct {
TargetPort util.IntOrString `json:"targetPort"` TargetPort util.IntOrString `json:"targetPort"`
// The port on each node on which this service is exposed. // The port on each node on which this service is exposed.
// Default is to auto-allocate a port if the visibility of this Service requires one. // Default is to auto-allocate a port if the ServiceType of this Service requires one.
NodePort int `json:"nodePort" description:"the port on each node on which this service is exposed"` NodePort int `json:"nodePort" description:"the port on each node on which this service is exposed"`
} }
......
...@@ -1002,7 +1002,7 @@ const ( ...@@ -1002,7 +1002,7 @@ const (
ServiceTypeClusterIP ServiceType = "ClusterIP" ServiceTypeClusterIP ServiceType = "ClusterIP"
// ServiceTypeNodePort means a service will be exposed on one port of // ServiceTypeNodePort means a service will be exposed on one port of
// every node, in addition to 'ClusterIP' visibility. // every node, in addition to 'ClusterIP' type.
ServiceTypeNodePort ServiceType = "NodePort" ServiceTypeNodePort ServiceType = "NodePort"
// ServiceTypeLoadBalancer means a service will be exposed via an // ServiceTypeLoadBalancer means a service will be exposed via an
...@@ -1084,7 +1084,7 @@ type ServicePort struct { ...@@ -1084,7 +1084,7 @@ type ServicePort struct {
TargetPort util.IntOrString `json:"targetPort,omitempty" description:"the port to access on the pods targeted by the service; defaults to the service port"` TargetPort util.IntOrString `json:"targetPort,omitempty" description:"the port to access on the pods targeted by the service; defaults to the service port"`
// The port on each node on which this service is exposed. // The port on each node on which this service is exposed.
// Default is to auto-allocate a port if the visibility of this Service requires one. // Default is to auto-allocate a port if the ServiceType of this Service requires one.
NodePort int `json:"nodePort" description:"the port on each node on which this service is exposed"` NodePort int `json:"nodePort" description:"the port on each node on which this service is exposed"`
} }
......
...@@ -844,7 +844,7 @@ const ( ...@@ -844,7 +844,7 @@ const (
ServiceTypeClusterIP ServiceType = "ClusterIP" ServiceTypeClusterIP ServiceType = "ClusterIP"
// ServiceTypeNodePort means a service will be exposed on one port of // ServiceTypeNodePort means a service will be exposed on one port of
// every node, in addition to 'ClusterIP' visibility. // every node, in addition to 'ClusterIP' type.
ServiceTypeNodePort ServiceType = "NodePort" ServiceTypeNodePort ServiceType = "NodePort"
// ServiceTypeLoadBalancer means a service will be exposed via an // ServiceTypeLoadBalancer means a service will be exposed via an
...@@ -964,7 +964,7 @@ type ServicePort struct { ...@@ -964,7 +964,7 @@ type ServicePort struct {
ContainerPort util.IntOrString `json:"containerPort" description:"the port to access on the containers belonging to pods targeted by the service; defaults to the service port"` ContainerPort util.IntOrString `json:"containerPort" description:"the port to access on the containers belonging to pods targeted by the service; defaults to the service port"`
// The port on each node on which this service is exposed. // The port on each node on which this service is exposed.
// Default is to auto-allocate a port if the visibility of this Service requires one. // Default is to auto-allocate a port if the ServiceType of this Service requires one.
NodePort int `json:"nodePort" description:"the port on each node on which this service is exposed"` NodePort int `json:"nodePort" description:"the port on each node on which this service is exposed"`
} }
......
...@@ -846,7 +846,7 @@ const ( ...@@ -846,7 +846,7 @@ const (
ServiceTypeClusterIP ServiceType = "ClusterIP" ServiceTypeClusterIP ServiceType = "ClusterIP"
// ServiceTypeNodePort means a service will be exposed on one port of // ServiceTypeNodePort means a service will be exposed on one port of
// every node, in addition to 'ClusterIP' visibility. // every node, in addition to 'ClusterIP' type.
ServiceTypeNodePort ServiceType = "NodePort" ServiceTypeNodePort ServiceType = "NodePort"
// ServiceTypeLoadBalancer means a service will be exposed via an // ServiceTypeLoadBalancer means a service will be exposed via an
...@@ -968,7 +968,7 @@ type ServicePort struct { ...@@ -968,7 +968,7 @@ type ServicePort struct {
ContainerPort util.IntOrString `json:"containerPort" description:"the port to access on the containers belonging to pods targeted by the service; defaults to the service port"` ContainerPort util.IntOrString `json:"containerPort" description:"the port to access on the containers belonging to pods targeted by the service; defaults to the service port"`
// The port on each node on which this service is exposed. // The port on each node on which this service is exposed.
// Default is to auto-allocate a port if the visibility of this Service requires one. // Default is to auto-allocate a port if the ServiceType of this Service requires one.
NodePort int `json:"nodePort" description:"the port on each node on which this service is exposed"` NodePort int `json:"nodePort" description:"the port on each node on which this service is exposed"`
} }
......
...@@ -1006,7 +1006,7 @@ const ( ...@@ -1006,7 +1006,7 @@ const (
ServiceTypeClusterIP ServiceType = "ClusterIP" ServiceTypeClusterIP ServiceType = "ClusterIP"
// ServiceTypeNodePort means a service will be exposed on one port of // ServiceTypeNodePort means a service will be exposed on one port of
// every node, in addition to 'ClusterIP' visibility. // every node, in addition to 'ClusterIP' type.
ServiceTypeNodePort ServiceType = "NodePort" ServiceTypeNodePort ServiceType = "NodePort"
// ServiceTypeLoadBalancer means a service will be exposed via an // ServiceTypeLoadBalancer means a service will be exposed via an
...@@ -1091,7 +1091,7 @@ type ServicePort struct { ...@@ -1091,7 +1091,7 @@ type ServicePort struct {
TargetPort util.IntOrString `json:"targetPort,omitempty" description:"the port to access on the pods targeted by the service; defaults to the service port"` TargetPort util.IntOrString `json:"targetPort,omitempty" description:"the port to access on the pods targeted by the service; defaults to the service port"`
// The port on each node on which this service is exposed. // The port on each node on which this service is exposed.
// Default is to auto-allocate a port if the visibility of this Service requires one. // Default is to auto-allocate a port if the ServiceType of this Service requires one.
NodePort int `json:"nodePort" description:"the port on each node on which this service is exposed"` NodePort int `json:"nodePort" description:"the port on each node on which this service is exposed"`
} }
......
...@@ -509,7 +509,7 @@ func describeService(service *api.Service, endpoints *api.Endpoints, events *api ...@@ -509,7 +509,7 @@ func describeService(service *api.Service, endpoints *api.Endpoints, events *api
fmt.Fprintf(out, "IP:\t%s\n", service.Spec.PortalIP) fmt.Fprintf(out, "IP:\t%s\n", service.Spec.PortalIP)
if len(service.Status.LoadBalancer.Ingress) > 0 { if len(service.Status.LoadBalancer.Ingress) > 0 {
list := buildIngressString(service.Status.LoadBalancer.Ingress) list := buildIngressString(service.Status.LoadBalancer.Ingress)
fmt.Fprintf(out, "Ingress:\t%s\n", list) fmt.Fprintf(out, "LoadBalancer Ingress:\t%s\n", list)
} }
for i := range service.Spec.Ports { for i := range service.Spec.Ports {
sp := &service.Spec.Ports[i] sp := &service.Spec.Ports[i]
...@@ -519,6 +519,9 @@ func describeService(service *api.Service, endpoints *api.Endpoints, events *api ...@@ -519,6 +519,9 @@ func describeService(service *api.Service, endpoints *api.Endpoints, events *api
name = "<unnamed>" name = "<unnamed>"
} }
fmt.Fprintf(out, "Port:\t%s\t%d/%s\n", name, sp.Port, sp.Protocol) fmt.Fprintf(out, "Port:\t%s\t%d/%s\n", name, sp.Port, sp.Protocol)
if sp.NodePort != 0 {
fmt.Fprintf(out, "NodePort:\t%s\t%d/%s\n", name, sp.Port, sp.Protocol)
}
fmt.Fprintf(out, "Endpoints:\t%s\t%s\n", name, formatEndpoints(endpoints, util.NewStringSet(sp.Name))) fmt.Fprintf(out, "Endpoints:\t%s\t%s\n", name, formatEndpoints(endpoints, util.NewStringSet(sp.Name)))
} }
fmt.Fprintf(out, "Session Affinity:\t%s\n", service.Spec.SessionAffinity) fmt.Fprintf(out, "Session Affinity:\t%s\n", service.Spec.SessionAffinity)
......
...@@ -144,7 +144,7 @@ type Config struct { ...@@ -144,7 +144,7 @@ type Config struct {
// The name of the cluster. // The name of the cluster.
ClusterName string ClusterName string
// The range of ports to be assigned to services with visibility=NodePort or greater // The range of ports to be assigned to services with type=NodePort or greater
ServiceNodePorts util.PortRange ServiceNodePorts util.PortRange
} }
...@@ -236,7 +236,7 @@ func setDefaults(c *Config) { ...@@ -236,7 +236,7 @@ func setDefaults(c *Config) {
if c.ServiceNodePorts.Size == 0 { if c.ServiceNodePorts.Size == 0 {
// TODO: Currently no way to specify an empty range (do we need to allow this?) // TODO: Currently no way to specify an empty range (do we need to allow this?)
// We should probably allow this for clouds that don't require NodePort to do load-balancing (GCE) // We should probably allow this for clouds that don't require NodePort to do load-balancing (GCE)
// but then that breaks the strict nestedness of visibility. // but then that breaks the strict nestedness of ServiceType.
// Review post-v1 // Review post-v1
defaultServiceNodePorts := util.PortRange{Base: 30000, Size: 2767} defaultServiceNodePorts := util.PortRange{Base: 30000, Size: 2767}
c.ServiceNodePorts = defaultServiceNodePorts c.ServiceNodePorts = defaultServiceNodePorts
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment