Bug 1398062 - Create ExternalName services with spec.ports should fail or ignore ports value
Summary: Create ExternalName services with spec.ports should fail or ignore ports value
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 3.4.0
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: dhodovsk
QA Contact: DeShuai Ma
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-24 02:38 UTC by Zhang Cheng
Modified: 2017-01-31 15:38 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-31 15:38:13 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Zhang Cheng 2016-11-24 02:38:02 UTC
Description of problem: Create ExternalName services with spec.ports should fail or ignore ports value 

Version-Release number of selected component (if applicable):
openshift v3.4.0.29+ca980ba
kubernetes v1.4.0+776c994

How reproducible:
Always

Steps to Reproduce:
1. Try to create a externalname service with spec.ports
# cat ExternalSvc-with-port.yaml
apiVersion: v1
kind: Service
metadata:
  name: my-svc
spec:
  ports:
  - port: 12345
  type: ExternalName
  externalName: www.google.com

Actual results:
# oc create -f ExternalSvc-with-port.yaml
service "my-svc" created
# oc get svc
NAME      CLUSTER-IP   EXTERNAL-IP     PORT(S)     AGE
my-svc                 www.google.com   12345/TCP   5s
# oc describe svc my-svc
Name:			my-svc
Namespace:		chezhang
Labels:			<none>
Selector:		<none>
Type:			ExternalName
IP:			
External Name:		www.google.com
Port:			<unset>	12345/TCP
Endpoints:		<none>
Session Affinity:	None
No events.
# oc get svc my-svc -o yaml
apiVersion: v1
kind: Service
metadata:
  creationTimestamp: 2016-11-23T08:59:05Z
  name: my-svc
  namespace: chezhang
  resourceVersion: "26312"
  selfLink: /api/v1/namespaces/chezhang/services/my-svc
  uid: 16638755-b15b-11e6-8ee4-42010af00003
spec:
  externalName: www.google.com
  ports:
  - port: 12345
    protocol: TCP
    targetPort: 12345
  sessionAffinity: None
  type: ExternalName
status:
  loadBalancer: {}

Expected results: 
The service should be created failed, or created but ignore spec.port value in `oc get svc`, `oc describe svc` and `oc get svc -o yaml`.

Addition info: 
I did a compare test, tried to create a externalname service with spec.clusterIP, the actual results is create externalname service failed.
# cat ExternalSvc-with-IP.yaml
apiVersion: v1
kind: Service
metadata:
  name: my-svc
spec:
  clusterIP: 172.30.162.30
  type: ExternalName
  externalName: www.google.com
# oc create -f ExternalSvc-with-IP.yaml
The Service "my-svc" is invalid: spec.clusterIP: Invalid value: "172.30.162.30": must be empty for ExternalName services

Comment 2 Derek Carr 2017-01-31 15:38:13 UTC
See comment:
https://github.com/kubernetes/kubernetes/pull/39938#issuecomment-276133370

Unfortunately, closing this as wont fix, we can evaluate in future iterations of the API.


Note You need to log in before you can comment on or make changes to this bug.