diff --git a/cluster/addons/cluster-monitoring/v1beta3/grafana-service.yaml b/cluster/addons/cluster-monitoring/v1beta3/grafana-service.yaml index 95975074301d7..bdf4080d0b149 100644 --- a/cluster/addons/cluster-monitoring/v1beta3/grafana-service.yaml +++ b/cluster/addons/cluster-monitoring/v1beta3/grafana-service.yaml @@ -6,7 +6,7 @@ metadata: kubernetes.io/cluster-service: "true" name: monitoring-grafana spec: - containerPort: 80 + targetPort: 80 port: 80 selector: name: influxGrafana diff --git a/cluster/addons/cluster-monitoring/v1beta3/heapster-service.yaml b/cluster/addons/cluster-monitoring/v1beta3/heapster-service.yaml index ee39a3d90e393..e10a4f8d3fe78 100644 --- a/cluster/addons/cluster-monitoring/v1beta3/heapster-service.yaml +++ b/cluster/addons/cluster-monitoring/v1beta3/heapster-service.yaml @@ -6,7 +6,7 @@ metadata: kubernetes.io/cluster-service: "true" name: monitoring-heapster spec: - containerPort: 8082 + targetPort: 8082 port: 80 selector: name: heapster diff --git a/cluster/addons/cluster-monitoring/v1beta3/influxdb-service.yaml b/cluster/addons/cluster-monitoring/v1beta3/influxdb-service.yaml index ca844ef9e09f1..bf3465dc77fbd 100644 --- a/cluster/addons/cluster-monitoring/v1beta3/influxdb-service.yaml +++ b/cluster/addons/cluster-monitoring/v1beta3/influxdb-service.yaml @@ -5,7 +5,7 @@ metadata: name: influxGrafana name: monitoring-influxdb spec: - containerPort: 8086 + targetPort: 8086 port: 80 selector: name: influxGrafana diff --git a/cluster/addons/cluster-monitoring/v1beta3/influxdb-ui-service.yaml b/cluster/addons/cluster-monitoring/v1beta3/influxdb-ui-service.yaml index b77c8ab8ebe54..5073a30817cdf 100644 --- a/cluster/addons/cluster-monitoring/v1beta3/influxdb-ui-service.yaml +++ b/cluster/addons/cluster-monitoring/v1beta3/influxdb-ui-service.yaml @@ -5,7 +5,7 @@ metadata: name: influxGrafana name: monitoring-influxdb-ui spec: - containerPort: 8083 + targetPort: 8083 port: 80 selector: name: influxGrafana diff --git a/examples/cassandra/v1beta3/cassandra-service.yaml b/examples/cassandra/v1beta3/cassandra-service.yaml index 09a886818e99b..08a8f744daec8 100644 --- a/examples/cassandra/v1beta3/cassandra-service.yaml +++ b/examples/cassandra/v1beta3/cassandra-service.yaml @@ -5,7 +5,7 @@ metadata: name: cassandra name: cassandra spec: - containerPort: 9042 + targetPort: 9042 port: 9042 selector: name: cassandra diff --git a/examples/hazelcast/v1beta3/hazelcast-service.yaml b/examples/hazelcast/v1beta3/hazelcast-service.yaml index b726d568000cb..186eaad570f63 100644 --- a/examples/hazelcast/v1beta3/hazelcast-service.yaml +++ b/examples/hazelcast/v1beta3/hazelcast-service.yaml @@ -5,7 +5,7 @@ metadata: name: hazelcast name: hazelcast spec: - containerPort: 5701 + targetPort: 5701 port: 5701 selector: name: hazelcast diff --git a/examples/mysql-wordpress-pd/v1beta3/mysql-service.yaml b/examples/mysql-wordpress-pd/v1beta3/mysql-service.yaml index 3bf5f2825fc74..38fb46a9dee89 100644 --- a/examples/mysql-wordpress-pd/v1beta3/mysql-service.yaml +++ b/examples/mysql-wordpress-pd/v1beta3/mysql-service.yaml @@ -5,7 +5,7 @@ metadata: name: mysql name: mysql spec: - containerPort: 3306 + targetPort: 3306 port: 3306 selector: name: mysql diff --git a/examples/mysql-wordpress-pd/v1beta3/wordpress-service.yaml b/examples/mysql-wordpress-pd/v1beta3/wordpress-service.yaml index c1988c271868a..8069b06a2bdd1 100644 --- a/examples/mysql-wordpress-pd/v1beta3/wordpress-service.yaml +++ b/examples/mysql-wordpress-pd/v1beta3/wordpress-service.yaml @@ -5,7 +5,7 @@ metadata: name: wpfrontend name: wpfrontend spec: - containerPort: 80 + targetPort: 80 port: 80 selector: name: wpfrontend diff --git a/examples/redis/v1beta3/redis-sentinel-service.yaml b/examples/redis/v1beta3/redis-sentinel-service.yaml index 0cdaf50fda67f..2c8bcaa46d736 100644 --- a/examples/redis/v1beta3/redis-sentinel-service.yaml +++ b/examples/redis/v1beta3/redis-sentinel-service.yaml @@ -6,7 +6,7 @@ metadata: role: service name: redis-sentinel spec: - containerPort: 26379 + targetPort: 26379 port: 26379 selector: redis-sentinel: "true" diff --git a/examples/rethinkdb/v1beta3/admin-service.yaml b/examples/rethinkdb/v1beta3/admin-service.yaml index 7efbfc58083f1..91fc19452acb8 100644 --- a/examples/rethinkdb/v1beta3/admin-service.yaml +++ b/examples/rethinkdb/v1beta3/admin-service.yaml @@ -6,7 +6,7 @@ metadata: name: rethinkdb-admin namespace: rethinkdb spec: - containerPort: 8080 + targetPort: 8080 port: 8080 selector: db: rethinkdb diff --git a/examples/rethinkdb/v1beta3/driver-service.yaml b/examples/rethinkdb/v1beta3/driver-service.yaml index b209c51f3480f..5b5163684f481 100644 --- a/examples/rethinkdb/v1beta3/driver-service.yaml +++ b/examples/rethinkdb/v1beta3/driver-service.yaml @@ -6,7 +6,7 @@ metadata: name: rethinkdb-driver namespace: rethinkdb spec: - containerPort: 28015 + targetPort: 28015 port: 28015 selector: db: rethinkdb diff --git a/examples/walkthrough/v1beta3/service.yaml b/examples/walkthrough/v1beta3/service.yaml index 3cd285fd5757a..a6a9c187d6dac 100644 --- a/examples/walkthrough/v1beta3/service.yaml +++ b/examples/walkthrough/v1beta3/service.yaml @@ -5,7 +5,7 @@ metadata: spec: # the container on each pod to connect to, can be a name # (e.g. 'www') or a number (e.g. 80) - containerPort: 80 + targetPort: 80 # the port that this service should serve on port: 8000 protocol: TCP diff --git a/pkg/api/testing/fuzzer.go b/pkg/api/testing/fuzzer.go index ea2993655f87e..3aaa06cdbccc1 100644 --- a/pkg/api/testing/fuzzer.go +++ b/pkg/api/testing/fuzzer.go @@ -27,9 +27,9 @@ import ( "github.com/GoogleCloudPlatform/kubernetes/pkg/runtime" "github.com/GoogleCloudPlatform/kubernetes/pkg/types" "github.com/GoogleCloudPlatform/kubernetes/pkg/util" - "github.com/fsouza/go-dockerclient" "github.com/google/gofuzz" + "speter.net/go/exp/math/dec/inf" ) @@ -212,11 +212,11 @@ func FuzzerFor(t *testing.T, version string, src rand.Source) *fuzz.Fuzzer { }, func(ss *api.ServiceSpec, c fuzz.Continue) { c.FuzzNoCustom(ss) // fuzz self without calling this function again - switch ss.ContainerPort.Kind { + switch ss.TargetPort.Kind { case util.IntstrInt: - ss.ContainerPort.IntVal = 1 + ss.ContainerPort.IntVal%65535 // non-zero + ss.TargetPort.IntVal = 1 + ss.TargetPort.IntVal%65535 // non-zero case util.IntstrString: - ss.ContainerPort.StrVal = "x" + ss.ContainerPort.StrVal // non-empty + ss.TargetPort.StrVal = "x" + ss.TargetPort.StrVal // non-empty } }, ) diff --git a/pkg/api/types.go b/pkg/api/types.go index ca8011fde23ff..ccffef8c2a0c6 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -759,12 +759,12 @@ type ServiceSpec struct { // For hostnames, the user will use a CNAME record (instead of using an A record with the IP) PublicIPs []string `json:"publicIPs,omitempty"` - // ContainerPort is the name or number of the port on the container to direct traffic to. + // TargetPort 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. // As of v1beta3 this field will become required in the internal API, // and the versioned APIs must provide a default value. - ContainerPort util.IntOrString `json:"containerPort,omitempty"` + TargetPort util.IntOrString `json:"targetPort,omitempty"` // Required: Supports "ClientIP" and "None". Used to maintain session affinity. SessionAffinity AffinityType `json:"sessionAffinity,omitempty"` diff --git a/pkg/api/v1beta1/conversion.go b/pkg/api/v1beta1/conversion.go index 99a54d5bdb67a..1ecceeacc39be 100644 --- a/pkg/api/v1beta1/conversion.go +++ b/pkg/api/v1beta1/conversion.go @@ -636,7 +636,7 @@ func init() { } out.CreateExternalLoadBalancer = in.Spec.CreateExternalLoadBalancer out.PublicIPs = in.Spec.PublicIPs - out.ContainerPort = in.Spec.ContainerPort + out.ContainerPort = in.Spec.TargetPort out.PortalIP = in.Spec.PortalIP if err := s.Convert(&in.Spec.SessionAffinity, &out.SessionAffinity, 0); err != nil { return err @@ -662,7 +662,7 @@ func init() { } out.Spec.CreateExternalLoadBalancer = in.CreateExternalLoadBalancer out.Spec.PublicIPs = in.PublicIPs - out.Spec.ContainerPort = in.ContainerPort + out.Spec.TargetPort = in.ContainerPort out.Spec.PortalIP = in.PortalIP if err := s.Convert(&in.SessionAffinity, &out.Spec.SessionAffinity, 0); err != nil { return err diff --git a/pkg/api/v1beta2/conversion.go b/pkg/api/v1beta2/conversion.go index c25e13ffd52a8..249b25a6d6f01 100644 --- a/pkg/api/v1beta2/conversion.go +++ b/pkg/api/v1beta2/conversion.go @@ -568,7 +568,7 @@ func init() { } out.CreateExternalLoadBalancer = in.Spec.CreateExternalLoadBalancer out.PublicIPs = in.Spec.PublicIPs - out.ContainerPort = in.Spec.ContainerPort + out.ContainerPort = in.Spec.TargetPort out.PortalIP = in.Spec.PortalIP if err := s.Convert(&in.Spec.SessionAffinity, &out.SessionAffinity, 0); err != nil { return err @@ -594,7 +594,7 @@ func init() { } out.Spec.CreateExternalLoadBalancer = in.CreateExternalLoadBalancer out.Spec.PublicIPs = in.PublicIPs - out.Spec.ContainerPort = in.ContainerPort + out.Spec.TargetPort = in.ContainerPort out.Spec.PortalIP = in.PortalIP if err := s.Convert(&in.SessionAffinity, &out.Spec.SessionAffinity, 0); err != nil { return err diff --git a/pkg/api/v1beta3/defaults.go b/pkg/api/v1beta3/defaults.go index d9d74d78b20a1..0045489ae22c8 100644 --- a/pkg/api/v1beta3/defaults.go +++ b/pkg/api/v1beta3/defaults.go @@ -89,9 +89,9 @@ func init() { } }, func(obj *ServiceSpec) { - if obj.ContainerPort.Kind == util.IntstrInt && obj.ContainerPort.IntVal == 0 || - obj.ContainerPort.Kind == util.IntstrString && obj.ContainerPort.StrVal == "" { - obj.ContainerPort = util.NewIntOrStringFromInt(obj.Port) + if obj.TargetPort.Kind == util.IntstrInt && obj.TargetPort.IntVal == 0 || + obj.TargetPort.Kind == util.IntstrString && obj.TargetPort.StrVal == "" { + obj.TargetPort = util.NewIntOrStringFromInt(obj.Port) } }, func(obj *NamespaceStatus) { diff --git a/pkg/api/v1beta3/defaults_test.go b/pkg/api/v1beta3/defaults_test.go index a4bac78f2f7d6..84e51d3048559 100644 --- a/pkg/api/v1beta3/defaults_test.go +++ b/pkg/api/v1beta3/defaults_test.go @@ -72,19 +72,19 @@ func TestSetDefaulEndpointsProtocol(t *testing.T) { } } -func TestSetDefaulServiceDestinationPort(t *testing.T) { +func TestSetDefaulServiceTargetPort(t *testing.T) { in := ¤t.Service{Spec: current.ServiceSpec{Port: 1234}} obj := roundTrip(t, runtime.Object(in)) out := obj.(*current.Service) - if out.Spec.ContainerPort.Kind != util.IntstrInt || out.Spec.ContainerPort.IntVal != 1234 { - t.Errorf("Expected ContainerPort to be defaulted, got %s", out.Spec.ContainerPort) + if out.Spec.TargetPort.Kind != util.IntstrInt || out.Spec.TargetPort.IntVal != 1234 { + t.Errorf("Expected TargetPort to be defaulted, got %s", out.Spec.TargetPort) } - in = ¤t.Service{Spec: current.ServiceSpec{Port: 1234, ContainerPort: util.NewIntOrStringFromInt(5678)}} + in = ¤t.Service{Spec: current.ServiceSpec{Port: 1234, TargetPort: util.NewIntOrStringFromInt(5678)}} obj = roundTrip(t, runtime.Object(in)) out = obj.(*current.Service) - if out.Spec.ContainerPort.Kind != util.IntstrInt || out.Spec.ContainerPort.IntVal != 5678 { - t.Errorf("Expected ContainerPort to be unchanged, got %s", out.Spec.ContainerPort) + if out.Spec.TargetPort.Kind != util.IntstrInt || out.Spec.TargetPort.IntVal != 5678 { + t.Errorf("Expected TargetPort to be unchanged, got %s", out.Spec.TargetPort) } } diff --git a/pkg/api/v1beta3/types.go b/pkg/api/v1beta3/types.go index 2b47b73a27a54..5c001e13472f7 100644 --- a/pkg/api/v1beta3/types.go +++ b/pkg/api/v1beta3/types.go @@ -751,10 +751,10 @@ type ServiceSpec struct { // 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"` - // ContainerPort is the name or number of the port on the container to direct traffic to. + // TargetPort 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 service port is used (an identity map). - 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"` + TargetPort util.IntOrString `json:"targetPort,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"` // Optional: Supports "ClientIP" and "None". Used to maintain session affinity. SessionAffinity AffinityType `json:"sessionAffinity,omitempty" description:"enable client IP based session affinity; must be ClientIP or None; defaults to None"` diff --git a/pkg/api/validation/validation.go b/pkg/api/validation/validation.go index 4502005917ac6..37cb90c34b936 100644 --- a/pkg/api/validation/validation.go +++ b/pkg/api/validation/validation.go @@ -735,9 +735,9 @@ func ValidateService(service *api.Service) errs.ValidationErrorList { } else if !supportedPortProtocols.Has(strings.ToUpper(string(service.Spec.Protocol))) { allErrs = append(allErrs, errs.NewFieldNotSupported("spec.protocol", service.Spec.Protocol)) } - if service.Spec.ContainerPort.Kind == util.IntstrInt && service.Spec.ContainerPort.IntVal != 0 && !util.IsValidPortNum(service.Spec.ContainerPort.IntVal) { + if service.Spec.TargetPort.Kind == util.IntstrInt && service.Spec.TargetPort.IntVal != 0 && !util.IsValidPortNum(service.Spec.TargetPort.IntVal) { allErrs = append(allErrs, errs.NewFieldInvalid("spec.containerPort", service.Spec.Port, portRangeErrorMsg)) - } else if service.Spec.ContainerPort.Kind == util.IntstrString && len(service.Spec.ContainerPort.StrVal) == 0 { + } else if service.Spec.TargetPort.Kind == util.IntstrString && len(service.Spec.TargetPort.StrVal) == 0 { allErrs = append(allErrs, errs.NewFieldRequired("spec.containerPort")) } diff --git a/pkg/api/validation/validation_test.go b/pkg/api/validation/validation_test.go index 331f6f442937f..f2f9f9ac97797 100644 --- a/pkg/api/validation/validation_test.go +++ b/pkg/api/validation/validation_test.go @@ -1149,16 +1149,16 @@ func TestValidateService(t *testing.T) { numErrs: 1, }, { - name: "missing destinationPort string", + name: "missing targetPort string", makeSvc: func(s *api.Service) { - s.Spec.ContainerPort = util.NewIntOrStringFromString("") + s.Spec.TargetPort = util.NewIntOrStringFromString("") }, numErrs: 1, }, { - name: "invalid destinationPort int", + name: "invalid targetPort int", makeSvc: func(s *api.Service) { - s.Spec.ContainerPort = util.NewIntOrStringFromInt(65536) + s.Spec.TargetPort = util.NewIntOrStringFromInt(65536) }, numErrs: 1, }, @@ -1180,14 +1180,14 @@ func TestValidateService(t *testing.T) { name: "valid 2", makeSvc: func(s *api.Service) { s.Spec.Protocol = "UDP" - s.Spec.ContainerPort = util.NewIntOrStringFromInt(12345) + s.Spec.TargetPort = util.NewIntOrStringFromInt(12345) }, numErrs: 0, }, { name: "valid 3", makeSvc: func(s *api.Service) { - s.Spec.ContainerPort = util.NewIntOrStringFromString("http") + s.Spec.TargetPort = util.NewIntOrStringFromString("http") }, numErrs: 0, }, diff --git a/pkg/kubectl/service.go b/pkg/kubectl/service.go index c496fcd133f13..ab4aadaff39b2 100644 --- a/pkg/kubectl/service.go +++ b/pkg/kubectl/service.go @@ -35,7 +35,8 @@ func (ServiceGenerator) ParamNames() []GeneratorParam { {"public-ip", false}, {"create-external-load-balancer", false}, {"protocol", false}, - {"container-port", false}, + {"container-port", false}, // alias of target-port + {"target-port", false}, } } @@ -75,15 +76,18 @@ func (ServiceGenerator) Generate(params map[string]string) (runtime.Object, erro Selector: selector, }, } - containerPort, found := params["container-port"] - if found && len(containerPort) > 0 { - if cPort, err := strconv.Atoi(containerPort); err != nil { - service.Spec.ContainerPort = util.NewIntOrStringFromString(containerPort) + targetPort, found := params["target-port"] + if !found { + targetPort, found = params["container-port"] + } + if found && len(targetPort) > 0 { + if portNum, err := strconv.Atoi(targetPort); err != nil { + service.Spec.TargetPort = util.NewIntOrStringFromString(targetPort) } else { - service.Spec.ContainerPort = util.NewIntOrStringFromInt(cPort) + service.Spec.TargetPort = util.NewIntOrStringFromInt(portNum) } } else { - service.Spec.ContainerPort = util.NewIntOrStringFromInt(port) + service.Spec.TargetPort = util.NewIntOrStringFromInt(port) } if params["create-external-load-balancer"] == "true" { service.Spec.CreateExternalLoadBalancer = true diff --git a/pkg/kubectl/service_test.go b/pkg/kubectl/service_test.go index 144e19544dfe5..2c60bb7826ab1 100644 --- a/pkg/kubectl/service_test.go +++ b/pkg/kubectl/service_test.go @@ -46,9 +46,9 @@ func TestGenerateService(t *testing.T) { "foo": "bar", "baz": "blah", }, - Port: 80, - Protocol: "TCP", - ContainerPort: util.NewIntOrStringFromInt(1234), + Port: 80, + Protocol: "TCP", + TargetPort: util.NewIntOrStringFromInt(1234), }, }, }, @@ -69,9 +69,9 @@ func TestGenerateService(t *testing.T) { "foo": "bar", "baz": "blah", }, - Port: 80, - Protocol: "UDP", - ContainerPort: util.NewIntOrStringFromString("foobar"), + Port: 80, + Protocol: "UDP", + TargetPort: util.NewIntOrStringFromString("foobar"), }, }, }, @@ -97,9 +97,9 @@ func TestGenerateService(t *testing.T) { "foo": "bar", "baz": "blah", }, - Port: 80, - Protocol: "TCP", - ContainerPort: util.NewIntOrStringFromInt(1234), + Port: 80, + Protocol: "TCP", + TargetPort: util.NewIntOrStringFromInt(1234), }, }, }, @@ -121,10 +121,10 @@ func TestGenerateService(t *testing.T) { "foo": "bar", "baz": "blah", }, - Port: 80, - Protocol: "UDP", - PublicIPs: []string{"1.2.3.4"}, - ContainerPort: util.NewIntOrStringFromString("foobar"), + Port: 80, + Protocol: "UDP", + PublicIPs: []string{"1.2.3.4"}, + TargetPort: util.NewIntOrStringFromString("foobar"), }, }, }, @@ -150,7 +150,7 @@ func TestGenerateService(t *testing.T) { Port: 80, Protocol: "UDP", PublicIPs: []string{"1.2.3.4"}, - ContainerPort: util.NewIntOrStringFromString("foobar"), + TargetPort: util.NewIntOrStringFromString("foobar"), CreateExternalLoadBalancer: true, }, }, diff --git a/pkg/service/endpoints_controller.go b/pkg/service/endpoints_controller.go index 453153d40b25e..3efcac5e29857 100644 --- a/pkg/service/endpoints_controller.go +++ b/pkg/service/endpoints_controller.go @@ -68,7 +68,7 @@ func (e *EndpointController) SyncServiceEndpoints() error { for _, pod := range pods.Items { // TODO: Once v1beta1 and v1beta2 are EOL'ed, this can - // assume that service.Spec.ContainerPort is populated. + // assume that service.Spec.TargetPort is populated. _ = v1beta1.Dependency _ = v1beta2.Dependency port, err := findPort(&pod, &service) @@ -196,7 +196,7 @@ func findDefaultPort(pod *api.Pod, servicePort int) (int, bool) { // findPort locates the container port for the given manifest and portName. func findPort(pod *api.Pod, service *api.Service) (int, error) { - portName := service.Spec.ContainerPort + portName := service.Spec.TargetPort switch portName.Kind { case util.IntstrString: if len(portName.StrVal) == 0 { diff --git a/pkg/service/endpoints_controller_test.go b/pkg/service/endpoints_controller_test.go index 515cb34ade91c..5c2cbbebdf07d 100644 --- a/pkg/service/endpoints_controller_test.go +++ b/pkg/service/endpoints_controller_test.go @@ -213,7 +213,7 @@ func TestFindPort(t *testing.T) { }, } for _, test := range tests { - port, err := findPort(&test.pod, &api.Service{Spec: api.ServiceSpec{Port: servicePort, ContainerPort: test.portName}}) + port, err := findPort(&test.pod, &api.Service{Spec: api.ServiceSpec{Port: servicePort, TargetPort: test.portName}}) if port != test.wport { t.Errorf("Expected port %d, Got %d", test.wport, port) } diff --git a/test/e2e/networking.go b/test/e2e/networking.go index 2b15068ccc8db..097eabc2398ed 100644 --- a/test/e2e/networking.go +++ b/test/e2e/networking.go @@ -77,8 +77,8 @@ var _ = Describe("Networking", func() { }, }, Spec: api.ServiceSpec{ - Port: 8080, - ContainerPort: util.NewIntOrStringFromInt(8080), + Port: 8080, + TargetPort: util.NewIntOrStringFromInt(8080), Selector: map[string]string{ "name": name, }, diff --git a/test/e2e/pods.go b/test/e2e/pods.go index d7907d9403500..024483167bcec 100644 --- a/test/e2e/pods.go +++ b/test/e2e/pods.go @@ -307,8 +307,8 @@ var _ = Describe("Pods", func() { }, }, Spec: api.ServiceSpec{ - Port: 8765, - ContainerPort: util.NewIntOrStringFromInt(8080), + Port: 8765, + TargetPort: util.NewIntOrStringFromInt(8080), Selector: map[string]string{ "name": serverName, }, diff --git a/test/e2e/service.go b/test/e2e/service.go index af003e51376ae..afeb614f96c3e 100644 --- a/test/e2e/service.go +++ b/test/e2e/service.go @@ -197,9 +197,9 @@ var _ = Describe("Services", func() { Name: serviceName, }, Spec: api.ServiceSpec{ - Port: 80, - Selector: labels, - ContainerPort: util.NewIntOrStringFromInt(80), + Port: 80, + Selector: labels, + TargetPort: util.NewIntOrStringFromInt(80), }, } _, err := c.Services(ns).Create(service) @@ -257,7 +257,7 @@ var _ = Describe("Services", func() { Spec: api.ServiceSpec{ Port: 80, Selector: labels, - ContainerPort: util.NewIntOrStringFromInt(80), + TargetPort: util.NewIntOrStringFromInt(80), CreateExternalLoadBalancer: true, }, }