Uploaded image for project: 'Stratos'
  1. Stratos
  2. STRATOS-1577

Kubernetes service creation fails when multiple port mappings are defined in cartridge definition

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.2
    • Fix Version/s: 4.1.3
    • Component/s: Cloud Controller
    • Labels:
      None

      Description

      Following error can be seen when deploying an application with a cartridge that has multiple port mappings with a min count of at least 2.

      org.apache.stratos.kubernetes.client.exceptions.KubernetesClientException: Could not create kubernetes service: [service-id] service-38 [service-name] f51f239123de34cd9ece9ed14309e1d7 [node-port] 30009 [container-port-name] thrift-7611 [container-port] 7611
      at org.apache.stratos.kubernetes.client.KubernetesApiClient.createService(KubernetesApiClient.java:233)
      at org.apache.stratos.cloud.controller.iaases.kubernetes.KubernetesIaas.createKubernetesServices(KubernetesIaas.java:589)
      at org.apache.stratos.cloud.controller.iaases.kubernetes.KubernetesIaas.startContainer(KubernetesIaas.java:225)
      at org.apache.stratos.cloud.controller.iaases.kubernetes.KubernetesIaas.startInstance(KubernetesIaas.java:126)
      at org.apache.stratos.cloud.controller.services.impl.InstanceCreator.startInstance(InstanceCreator.java:109)
      at org.apache.stratos.cloud.controller.services.impl.InstanceCreator.run(InstanceCreator.java:68)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: javax.ws.rs.WebApplicationException: HTTP 422 Service "service-38" is invalid: spec.ports[0].nodePort: invalid value '30009': provided port is already allocated
      at io.fabric8.kubernetes.api.ExceptionResponseMapper.fromResponse(ExceptionResponseMapper.java:40)
      at io.fabric8.kubernetes.api.ExceptionResponseMapper.fromResponse(ExceptionResponseMapper.java:31)
      at org.apache.cxf.jaxrs.client.ClientProxyImpl.checkResponse(ClientProxyImpl.java:302)
      at org.apache.cxf.jaxrs.client.ClientProxyImpl.handleResponse(ClientProxyImpl.java:725)
      at org.apache.cxf.jaxrs.client.ClientProxyImpl.doChainedInvocation(ClientProxyImpl.java:683)
      at org.apache.cxf.jaxrs.client.ClientProxyImpl.invoke(ClientProxyImpl.java:224)
      at com.sun.proxy.$Proxy83.createService(Unknown Source)
      at io.fabric8.kubernetes.api.KubernetesClient.createService(KubernetesClient.java:440)
      at io.fabric8.kubernetes.api.KubernetesClient.createService(KubernetesClient.java:430)
      at org.apache.stratos.kubernetes.client.KubernetesApiClient.createService(KubernetesApiClient.java:220)
      ... 8 more

        Attachments

          Activity

            People

            • Assignee:
              imesh Imesh Gunaratne
              Reporter:
              ravihansa Akila
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: