From 3301f19a8aaff17729e87b0210f0a9c887cd583e Mon Sep 17 00:00:00 2001 From: Alex Robinson Date: Thu, 12 Feb 2015 01:57:51 +0000 Subject: [PATCH] Add extra explanation of the purpose of service's ContainerPort field to the API comments. We were asked about this in issue #4332. --- pkg/api/types.go | 5 +++-- pkg/api/v1beta1/types.go | 7 ++++--- pkg/api/v1beta2/types.go | 7 ++++--- pkg/api/v1beta3/types.go | 5 +++-- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/pkg/api/types.go b/pkg/api/types.go index e841d4b8301e6..a2e83e5d46f40 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -710,8 +710,9 @@ type ServiceSpec struct { // PublicIPs are used by external load balancers. PublicIPs []string `json:"publicIPs,omitempty"` - // ContainerPort is the name of the port on the container to direct traffic to. - // Optional, if unspecified use the first port on the container. + // ContainerPort is the name or number of the port on the container to direct traffic to. + // This is useful if the containers the service points to have multiple open ports. + // Optional: If unspecified, the first port on the container will be used. ContainerPort util.IntOrString `json:"containerPort,omitempty"` // Optional: Supports "ClientIP" and "None". Used to maintain session affinity. diff --git a/pkg/api/v1beta1/types.go b/pkg/api/v1beta1/types.go index ab6a565120006..fb5fb8d138850 100644 --- a/pkg/api/v1beta1/types.go +++ b/pkg/api/v1beta1/types.go @@ -573,9 +573,10 @@ type Service struct { // PublicIPs are used by external load balancers. PublicIPs []string `json:"publicIPs,omitempty" description:"externally visible IPs from which to select the address for the external load balancer"` - // ContainerPort is the name of the port on the container to direct traffic to. - // Optional, if unspecified use the first port on the container. - ContainerPort util.IntOrString `json:"containerPort,omitempty" description:"number or name of the port to access on the containers belonging to pods targeted by the service"` + // ContainerPort is the name or number of the port on the container to direct traffic to. + // This is useful if the containers the service points to have multiple open ports. + // Optional: If unspecified, the first port on the container will be used. + ContainerPort util.IntOrString `json:"containerPort,omitempty" description:"number or name of the port to access on the containers belonging to pods targeted by the service; defaults to the container's first open port"` // PortalIP is usually assigned by the master. If specified by the user // we will try to respect it or else fail the request. This field can diff --git a/pkg/api/v1beta2/types.go b/pkg/api/v1beta2/types.go index 25ac7b3ac5212..5f4f1045d665e 100644 --- a/pkg/api/v1beta2/types.go +++ b/pkg/api/v1beta2/types.go @@ -537,9 +537,10 @@ type Service struct { // PublicIPs are used by external load balancers. PublicIPs []string `json:"publicIPs,omitempty" description:"externally visible IPs from which to select the address for the external load balancer"` - // ContainerPort is the name of the port on the container to direct traffic to. - // Optional, if unspecified use the first port on the container. - ContainerPort util.IntOrString `json:"containerPort,omitempty" description:"number or name of the port to access on the containers belonging to pods targeted by the service"` + // ContainerPort is the name or number of the port on the container to direct traffic to. + // This is useful if the containers the service points to have multiple open ports. + // Optional: If unspecified, the first port on the container will be used. + ContainerPort util.IntOrString `json:"containerPort,omitempty" description:"number or name of the port to access on the containers belonging to pods targeted by the service; defaults to the container's first open port"` // PortalIP is usually assigned by the master. If specified by the user // we will try to respect it or else fail the request. This field can diff --git a/pkg/api/v1beta3/types.go b/pkg/api/v1beta3/types.go index 844e20d121ac1..d14313cebbaa2 100644 --- a/pkg/api/v1beta3/types.go +++ b/pkg/api/v1beta3/types.go @@ -734,8 +734,9 @@ type ServiceSpec struct { // PublicIPs are used by external load balancers. PublicIPs []string `json:"publicIPs,omitempty"` - // ContainerPort is the name of the port on the container to direct traffic to. - // Optional, if unspecified use the first port on the container. + // ContainerPort is the name or number of the port on the container to direct traffic to. + // This is useful if the containers the service points to have multiple open ports. + // Optional: If unspecified, the first port on the container will be used. ContainerPort util.IntOrString `json:"containerPort,omitempty"` // Optional: Supports "ClientIP" and "None". Used to maintain session affinity.