• Kubernetes Submit Queue's avatar
    Merge pull request #41115 from rajatchopra/kube_service_fix · cfb08cd9
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue
    
    fix service spec for kube api server
    
    For the auto generated kube api-server service, the service spec re-uses the service port itself. The endpoint is created correctly using public port. Fix the service also because there are some plugin controllers that react to service spec itself.
    
    Before fix:
    ```
    sh-4.2# kubectl get endpoints
    NAME         ENDPOINTS                                         AGE
    kubernetes   172.17.0.2:8443,172.17.0.2:8053,172.17.0.2:8053   20h
    
    sh-4.2# kubectl get services kubernetes -o json
    ...
    ...
            "spec": {
                    "clusterIP": "172.30.0.1",
                    "ports": [
                        {
                            "name": "https",
                            "port": 443,
                            "protocol": "TCP",
                            "targetPort": 443     ## <--- same as port, even if the endpoint really means 8443
                        },
                        {
                            "name": "dns",
                            "port": 53,
                            "protocol": "UDP",
                            "targetPort": 8053
                        },
                        {
                            "name": "dns-tcp",
                             ...
    ```
    
    After fix:
    ```
    "spec": {
                    "clusterIP": "172.30.0.1",
                    "ports": [
                        {
                            "name": "https",
                            "port": 443,
                            "protocol": "TCP",
                            "targetPort": 8443     # <-- fixed, now matches the endpoint object
                        },
                        {
                            "name": "dns",
                            "port": 53,
                            "protocol": "UDP",
                            "targetPort": 8053
                        },
                        {
                            "name": "dns-tcp",
    
    ``
    cfb08cd9
Name
Last commit
Last update
..
ports Loading commit data...
thirdparty Loading commit data...
tunneler Loading commit data...
BUILD Loading commit data...
OWNERS Loading commit data...
controller.go Loading commit data...
controller_test.go Loading commit data...
doc.go Loading commit data...
import_known_versions.go Loading commit data...
import_known_versions_test.go Loading commit data...
master.go Loading commit data...
master_openapi_test.go Loading commit data...
master_test.go Loading commit data...
services.go Loading commit data...