Hide Forgot
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
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.