From 9255770068db756522285137c1f24599c57b7976 Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Fri, 22 May 2015 18:58:39 -0400 Subject: [PATCH] Fix a few occurences of old language (e.g. visibility -> ServiceType) --- pkg/api/types.go | 4 ++-- pkg/api/v1/types.go | 4 ++-- pkg/api/v1beta1/types.go | 4 ++-- pkg/api/v1beta2/types.go | 4 ++-- pkg/api/v1beta3/types.go | 4 ++-- pkg/kubectl/describe.go | 5 ++++- pkg/master/master.go | 4 ++-- 7 files changed, 16 insertions(+), 13 deletions(-) diff --git a/pkg/api/types.go b/pkg/api/types.go index 85f661260bd..83ffbc7e970 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -1020,7 +1020,7 @@ const ( ServiceTypeClusterIP ServiceType = "ClusterIP" // 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" // ServiceTypeLoadBalancer means a service will be exposed via an @@ -1106,7 +1106,7 @@ type ServicePort struct { TargetPort util.IntOrString `json:"targetPort"` // 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"` } diff --git a/pkg/api/v1/types.go b/pkg/api/v1/types.go index 815ab591714..2d8cc03d5dc 100644 --- a/pkg/api/v1/types.go +++ b/pkg/api/v1/types.go @@ -1002,7 +1002,7 @@ const ( ServiceTypeClusterIP ServiceType = "ClusterIP" // 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" // ServiceTypeLoadBalancer means a service will be exposed via an @@ -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"` // 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"` } diff --git a/pkg/api/v1beta1/types.go b/pkg/api/v1beta1/types.go index 815fc1b90b2..28efed20e50 100644 --- a/pkg/api/v1beta1/types.go +++ b/pkg/api/v1beta1/types.go @@ -844,7 +844,7 @@ const ( ServiceTypeClusterIP ServiceType = "ClusterIP" // 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" // ServiceTypeLoadBalancer means a service will be exposed via an @@ -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"` // 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"` } diff --git a/pkg/api/v1beta2/types.go b/pkg/api/v1beta2/types.go index 06c2998a467..4bfc4ec46c3 100644 --- a/pkg/api/v1beta2/types.go +++ b/pkg/api/v1beta2/types.go @@ -846,7 +846,7 @@ const ( ServiceTypeClusterIP ServiceType = "ClusterIP" // 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" // ServiceTypeLoadBalancer means a service will be exposed via an @@ -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"` // 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"` } diff --git a/pkg/api/v1beta3/types.go b/pkg/api/v1beta3/types.go index 27df9272ed5..c0cecc182f6 100644 --- a/pkg/api/v1beta3/types.go +++ b/pkg/api/v1beta3/types.go @@ -1006,7 +1006,7 @@ const ( ServiceTypeClusterIP ServiceType = "ClusterIP" // 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" // ServiceTypeLoadBalancer means a service will be exposed via an @@ -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"` // 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"` } diff --git a/pkg/kubectl/describe.go b/pkg/kubectl/describe.go index 127728613ea..30c54e1a378 100644 --- a/pkg/kubectl/describe.go +++ b/pkg/kubectl/describe.go @@ -509,7 +509,7 @@ func describeService(service *api.Service, endpoints *api.Endpoints, events *api fmt.Fprintf(out, "IP:\t%s\n", service.Spec.PortalIP) if len(service.Status.LoadBalancer.Ingress) > 0 { 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 { sp := &service.Spec.Ports[i] @@ -519,6 +519,9 @@ func describeService(service *api.Service, endpoints *api.Endpoints, events *api name = "" } 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, "Session Affinity:\t%s\n", service.Spec.SessionAffinity) diff --git a/pkg/master/master.go b/pkg/master/master.go index 9920cd2d4ff..afec344d3ba 100644 --- a/pkg/master/master.go +++ b/pkg/master/master.go @@ -144,7 +144,7 @@ type Config struct { // The name of the cluster. 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 } @@ -236,7 +236,7 @@ func setDefaults(c *Config) { if c.ServiceNodePorts.Size == 0 { // 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) - // but then that breaks the strict nestedness of visibility. + // but then that breaks the strict nestedness of ServiceType. // Review post-v1 defaultServiceNodePorts := util.PortRange{Base: 30000, Size: 2767} c.ServiceNodePorts = defaultServiceNodePorts